Example #1
0
        public void Be_Equal_To_Null_Object_When_Is_Null()
        {
            //Arrange & Act
            ValueObjectToTest sut   = null;
            ValueObjectToTest other = null;

            //Assert
            sut.Should().Be((object)other);
        }
Example #2
0
        public void Be_Contained_In_Collection_With_Same_Value()
        {
            //Arrange & Act
            var sut   = new[] { new ValueObjectToTest("foo", 23) };
            var other = new ValueObjectToTest("foo", 23);

            //Assert
            sut.Should().Match(m => m.Contains(other));
            sut.Should().Match(m => m.Contains((object)other));
        }
Example #3
0
        public void Not_Be_Equal_To_Object_With_Other_Values()
        {
            //Arrange & Act
            var sut   = new ValueObjectToTest("foo", 23);
            var other = new ValueObjectToTest("bar", 11);

            //Assert
            sut.Should().NotBe((object)other);
            sut.Should().NotBe(other);
        }
Example #4
0
        public void Be_Equal_To_Object_With_Same_Values()
        {
            //Arrange & Act
            var sut   = new ValueObjectToTest("foo", 23);
            var other = new ValueObjectToTest("foo", 23);

            //Assert
            sut.Should().Be((object)other);
            sut.Should().Be(other);
        }