/// <summary> /// Use an instance matcher to allow passing in of an enum where a nullable enum is require /// </summary> /// <typeparam name="T"></typeparam> /// <param name="val"></param> /// <returns></returns> public static T?IsNotNull <T>(T val) where T : struct { if (_verifyLogToConsole) { return(AnInstance.EqualTo(val).VerifyLogToConsole()); } return(AnInstance.EqualTo(val).Verify()); }
public void EqualToFailsTest() { AssertFails("", AnInstance.EqualTo((string)null)); AssertFails(null, AnInstance.EqualTo("")); AssertFails("a", AnInstance.EqualTo("b")); AssertFails(5, AnInstance.EqualTo(6)); AssertFails(new Object(), AnInstance.EqualTo(new Object())); AssertFails(SettableEquals.Returns(true), AnInstance.EqualTo(SettableEquals.Returns(false))); }
public void EqualToPassesTest() { AssertPasses("", AnInstance.EqualTo("")); AssertPasses("a", AnInstance.EqualTo("a")); AssertPasses(5, AnInstance.EqualTo(5)); var instance = new Object(); AssertPasses(instance, AnInstance.EqualTo(instance)); AssertPasses(SettableEquals.Returns(true), AnInstance.EqualTo(SettableEquals.Returns(true))); //actuals Equals method shouldn't be invoked AssertPasses(SettableEquals.Returns(false), AnInstance.EqualTo(SettableEquals.Returns(true))); }
public AResponse ResultsNull() { Results(AnInstance.EqualTo <System.Collections.Generic.IEnumerable <TestFirst.Net.Examples.Api.Notification> >(null)); return(this); }
public AResponse ResultNull() { Result(AnInstance.EqualTo <TestFirst.Net.Examples.Api.Notification>(null)); return(this); }
public ATestDto MyDictionaryOfStringsNull() { MyDictionaryOfStrings(AnInstance.EqualTo <System.Collections.Generic.IDictionary <string, string> >(null)); return(this); }
public ATestDtoWithSubClass SubDtoNull() { SubDto(AnInstance.EqualTo <TestFirst.Net.Template.TestDtoWithSubClass.SubTestDto>(null)); return(this); }
public ATestDto MyUriNull() { MyUri(AnInstance.EqualTo <System.Uri>(null)); return(this); }
public ATestDto MyDtoEnmerableNull() { MyDtoEnmerable(AnInstance.EqualTo <TestFirst.Net.Template.TestDtoEnumerable>(null)); return(this); }
public ATestDto MyArrayOfStringsPropNull() { MyArrayOfStringsProp(AnInstance.EqualTo <string[]>(null)); return(this); }
public ATestDto MyNullTimeSpanNull() { MyNullTimeSpan(AnInstance.EqualTo <System.TimeSpan?>(null)); return(this); }
public ATestDto MyArrayOfNullIntsPropNull() { MyArrayOfNullIntsProp(AnInstance.EqualTo <int?[]>(null)); return(this); }
public ATestDto MyNullCharPropNull() { MyNullCharProp(AnInstance.EqualTo <char?>(null)); return(this); }
public ATestDto MyNullBytePropNull() { MyNullByteProp(AnInstance.EqualTo <byte?>(null)); return(this); }
public ATestDto MyListOfStringsPropNull() { MyListOfStringsProp(AnInstance.EqualTo <System.Collections.Generic.IEnumerable <string> >(null)); return(this); }
public ATestDto MyTestEnum(TestFirst.Net.Template.TestEnum?expect) { MyTestEnum(AnInstance.EqualTo(expect)); return(this); }
public ATestDto MyDto2Null() { MyDto2(AnInstance.EqualTo <TestFirst.Net.Template.TestDto2>(null)); return(this); }