Exemplo n.º 1
0
        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)));
        }
    }
Exemplo n.º 2
0
        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));
        }