public void Equal_When_All_Fields_Are_Equal() { var x = GetPrescriptionProduct(); var y = GetPrescriptionProduct(); var comparer = new PrescriptionProductComparer(); bool result = comparer.Equals(x, y); Assert.IsTrue(result); }
public void Return_Correct_HashCode_From_Fields() { var prescriptionProduct = GetPrescriptionProduct(); int expectedHashCode = (byte)prescriptionProduct.MutKod ^ prescriptionProduct.PrKode ^ prescriptionProduct.PrNmNr; var comparer = new PrescriptionProductComparer(); int result = comparer.GetHashCode(prescriptionProduct); Assert.AreEqual(expectedHashCode, result); }
public void Not_Equal_When_PrNmNr_Is_Different() { var x = GetPrescriptionProduct(); var y = GetPrescriptionProduct(); y.PrNmNr = 3; var comparer = new PrescriptionProductComparer(); bool result = comparer.Equals(x, y); Assert.IsFalse(result); }
public void Not_Equal_When_MutKod_Is_Different() { var x = GetPrescriptionProduct(); var y = GetPrescriptionProduct(); y.MutKod = MutKod.RecordUpdated; var comparer = new PrescriptionProductComparer(); bool result = comparer.Equals(x, y); Assert.IsFalse(result); }