public void RuntimeTypeWithExpression() { PersonRecordImmutable student = new StudentRecordImmutable { FirstName = "Damir", LastName = "Arh", }; var newStudent = student with { FirstName = "Damjan" }; Assert.That(newStudent.GetType(), Is.EqualTo(typeof(StudentRecordImmutable))); } }
public void RuntimeTypeEquality() { PersonRecordImmutable person = new PersonRecordImmutable { FirstName = "Damir", LastName = "Arh", }; PersonRecordImmutable student = new StudentRecordImmutable { FirstName = "Damir", LastName = "Arh", }; Assert.That(person, Is.Not.EqualTo(student)); }