diff --git a/test/OpenFeature.Tests/FlagMetadataTest.cs b/test/OpenFeature.Tests/FlagMetadataTest.cs index 1989e8ef..88d248de 100644 --- a/test/OpenFeature.Tests/FlagMetadataTest.cs +++ b/test/OpenFeature.Tests/FlagMetadataTest.cs @@ -61,11 +61,10 @@ public void GetBool_Should_Throw_Value_Is_Invalid() var flagMetadata = new FlagMetadata(metadata); // Act - var exception = Assert.Throws(() => flagMetadata.GetBool("wrongKey")); + var result = flagMetadata.GetBool("wrongKey"); // Assert - Assert.NotNull(exception); - Assert.Equal("Cannot cast System.String to System.Boolean", exception.Message); + Assert.Null(result); } [Fact] @@ -121,11 +120,10 @@ public void GetInt_Should_Throw_Value_Is_Invalid() var flagMetadata = new FlagMetadata(metadata); // Act - var exception = Assert.Throws(() => flagMetadata.GetInt("wrongKey")); + var result = flagMetadata.GetInt("wrongKey"); // Assert - Assert.NotNull(exception); - Assert.Equal("Cannot cast System.String to System.Int32", exception.Message); + Assert.Null(result); } [Fact] @@ -181,11 +179,10 @@ public void GetDouble_Should_Throw_Value_Is_Invalid() var flagMetadata = new FlagMetadata(metadata); // Act - var exception = Assert.Throws(() => flagMetadata.GetDouble("wrongKey")); + var result = flagMetadata.GetDouble("wrongKey"); // Assert - Assert.NotNull(exception); - Assert.Equal("Cannot cast System.String to System.Double", exception.Message); + Assert.Null(result); } [Fact] @@ -241,10 +238,9 @@ public void GetString_Should_Throw_Value_Is_Invalid() var flagMetadata = new FlagMetadata(metadata); // Act - var exception = Assert.Throws(() => flagMetadata.GetString("wrongKey")); + var result = flagMetadata.GetString("wrongKey"); // Assert - Assert.NotNull(exception); - Assert.Equal("Cannot cast System.Object to System.String", exception.Message); + Assert.Null(result); } }