public void InitOnlyPropertiesAllowImmutableClassWithInitializer() { var person = new PersonInitOnly { FirstName = "Damir", LastName = "Arh", }; // doesn't compile // person.FirstName = "Damjan"; }
public void ClassesUseReferenceEquality() { var person1 = new PersonInitOnly { FirstName = "Damir", LastName = "Arh", }; var person2 = new PersonInitOnly { FirstName = "Damir", LastName = "Arh", }; Assert.That(person1, Is.Not.EqualTo(person2)); }