public void GetValueNullValueTest() { var values = new Dictionary <String, Object> { { "MyString", null } }; var target = new LookuptValueProvider(values); var value = target.GetValue("MyString"); value.Should() .BeNull(); }
public void GetValueFalseFormatTest() { var values = new Dictionary <String, Object> { { "MyInt", DateTime.Now } }; var target = new LookuptValueProvider(values); var actual = target.GetValue("MyInt:DD"); actual.Should() .Be("DD"); }
public void GetValueMissingKeyWithFormatTest() { var values = new Dictionary <String, Object> { { "MyString", "asdf" } }; var target = new LookuptValueProvider(values); Action test = () => target.GetValue("MyInt:000"); test.ShouldThrow <FormatException>() .WithInnerException <KeyNotFoundException>(); }
public void GetValueMissingKeyWithFormatTest() { var values = new Dictionary <String, Object> { { "MyString", "asdf" } }; var target = new LookuptValueProvider(values); Action test = () => target.GetValue("MyInt:000"); var exception = Assert.Throws <FormatException>(test); Assert.IsType <KeyNotFoundException>(exception.InnerException); }
public void GetValueNoneStringTest() { var values = new Dictionary <String, Object> { { "MyString", "asdf" }, { "MyInt", 1234 } }; var target = new LookuptValueProvider(values); var value = target.GetValue("MyInt"); value.Should() .Be("1234"); }