public void Mashs_Valid_NonEmpty() { Mashs mashs = new Mashs(); Mock <Mash> mash = GetMockMash(); mash.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true); mashs.Add(mash.Object); ValidationCode errorCode = ValidationCode.SUCCESS; // need to suppress the type check because moq uses a different type Assert.IsTrue(mashs.IsValidRecordSet(ref errorCode, suppressTypeCheck: true)); }
public void Mashs_Invalid_BadType() { Mashs mashs = new Mashs(); Mock <Mash> mash = GetMockMash(); mash.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true); mashs.Add(mash.Object); ValidationCode errorCode = ValidationCode.SUCCESS; // do not suppress type check. Since moq uses a different type anyway, // there is no need to test with a different IRecord type Assert.IsFalse(mashs.IsValidRecordSet(ref errorCode, suppressTypeCheck: false)); }
public void Mashs_Valid_Empty() { Mashs mashs = new Mashs(); Assert.IsTrue(mashs.IsValid()); }