public void Waters_Valid_NonEmpty() { Waters waters = new Waters(); Mock <Water> water = GetMockWater(); water.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true); waters.Add(water.Object); ValidationCode errorCode = ValidationCode.SUCCESS; // need to suppress the type check because moq uses a different type Assert.IsTrue(waters.IsValidRecordSet(ref errorCode, suppressTypeCheck: true)); }
public void Waters_Invalid_BadType() { Waters waters = new Waters(); Mock <Water> water = GetMockWater(); water.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true); waters.Add(water.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(waters.IsValidRecordSet(ref errorCode, suppressTypeCheck: false)); }