Example #1
0
 /// <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());
 }
Example #2
0
 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)));
 }
Example #3
0
        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)));
        }
Example #4
0
 public AResponse ResultsNull()
 {
     Results(AnInstance.EqualTo <System.Collections.Generic.IEnumerable <TestFirst.Net.Examples.Api.Notification> >(null));
     return(this);
 }
Example #5
0
 public AResponse ResultNull()
 {
     Result(AnInstance.EqualTo <TestFirst.Net.Examples.Api.Notification>(null));
     return(this);
 }
Example #6
0
 public ATestDto MyDictionaryOfStringsNull()
 {
     MyDictionaryOfStrings(AnInstance.EqualTo <System.Collections.Generic.IDictionary <string, string> >(null));
     return(this);
 }
Example #7
0
 public ATestDtoWithSubClass SubDtoNull()
 {
     SubDto(AnInstance.EqualTo <TestFirst.Net.Template.TestDtoWithSubClass.SubTestDto>(null));
     return(this);
 }
Example #8
0
 public ATestDto MyUriNull()
 {
     MyUri(AnInstance.EqualTo <System.Uri>(null));
     return(this);
 }
Example #9
0
 public ATestDto MyDtoEnmerableNull()
 {
     MyDtoEnmerable(AnInstance.EqualTo <TestFirst.Net.Template.TestDtoEnumerable>(null));
     return(this);
 }
Example #10
0
 public ATestDto MyArrayOfStringsPropNull()
 {
     MyArrayOfStringsProp(AnInstance.EqualTo <string[]>(null));
     return(this);
 }
Example #11
0
 public ATestDto MyNullTimeSpanNull()
 {
     MyNullTimeSpan(AnInstance.EqualTo <System.TimeSpan?>(null));
     return(this);
 }
Example #12
0
 public ATestDto MyArrayOfNullIntsPropNull()
 {
     MyArrayOfNullIntsProp(AnInstance.EqualTo <int?[]>(null));
     return(this);
 }
Example #13
0
 public ATestDto MyNullCharPropNull()
 {
     MyNullCharProp(AnInstance.EqualTo <char?>(null));
     return(this);
 }
Example #14
0
 public ATestDto MyNullBytePropNull()
 {
     MyNullByteProp(AnInstance.EqualTo <byte?>(null));
     return(this);
 }
Example #15
0
 public ATestDto MyListOfStringsPropNull()
 {
     MyListOfStringsProp(AnInstance.EqualTo <System.Collections.Generic.IEnumerable <string> >(null));
     return(this);
 }
Example #16
0
 public ATestDto MyTestEnum(TestFirst.Net.Template.TestEnum?expect)
 {
     MyTestEnum(AnInstance.EqualTo(expect));
     return(this);
 }
Example #17
0
 public ATestDto MyDto2Null()
 {
     MyDto2(AnInstance.EqualTo <TestFirst.Net.Template.TestDto2>(null));
     return(this);
 }