Skip to content

Commit

Permalink
Fixed guid tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwhitney committed Apr 14, 2018
1 parent bb73544 commit 18e7165
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -14,7 +14,11 @@ public class AppSettingsExtendedTests
public void SetUp()
{
_underlyingConfiguration = new NameValueCollection {{"key-here", "junk"}};
_wrapper = new AppSettingsExtended(_underlyingConfiguration, null, new[] {new UriConverter()} /* Default */);
_wrapper = new AppSettingsExtended(_underlyingConfiguration, null, new List<IConvertType>
{
new UriConverter(),
new GuidConverter()
} /* Default */);
}

[Test]
Expand Down Expand Up @@ -444,7 +448,9 @@ public void Setting_WhenCastFailsAndActionNotSupplied_Throws()
var expected = new Guid("71a9bb5c-6f5d-4e18-8609-5f729aa352e6");
_underlyingConfiguration.Add("someGuidVal", expected.ToString());

Assert.Throws<InvalidCastException>(() => _wrapper.AppSetting<Guid>("someGuidVal"));
var parsed = _wrapper.AppSetting<Guid>("someGuidVal");

Assert.That(parsed.ToString(), Is.EqualTo(expected.ToString()));
}

[Test]
Expand Down

0 comments on commit 18e7165

Please sign in to comment.