Пример #1
0
 public void Assure_nonvalid_int_thows_exception()
 {
     try
     {
         SettingsEntry entry = new SettingsEntry("test", "hundre");
         var intValue = entry.ValueAsInt();
         Assert.Fail();
     }
     catch (ArgumentException argumentException)
     {
         argumentException.Message.ShouldBe("The value was not convertable to int: hundre");
     }
 }
Пример #2
0
 public void Assure_valid_ints_are_parsed_correctly()
 {
     SettingsEntry entry = new SettingsEntry("test", "100");
     var intValue = entry.ValueAsInt();
     intValue.ShouldBe(100);
 }