コード例 #1
0
ファイル: EqualityTests.cs プロジェクト: RossJayJones/ddd
        public void TheyShouldNotBeEqualWhenTheyAreDifferentTypes()
        {
            var aggregate1 = new MyFirstAggregate(new MyFirstAggregateId("a"));
            var aggregate2 = new MySecondAggregate(new MySecondAggregateId("a"));

            Assert.False(aggregate1.Equals(aggregate2));
        }
コード例 #2
0
ファイル: EqualityTests.cs プロジェクト: RossJayJones/ddd
        public void TheyShouldBeEqualWhenTheyHaveTheSameIdentity()
        {
            var aggregate1 = new MyFirstAggregate(new MyFirstAggregateId("a"));
            var aggregate2 = new MyFirstAggregate(new MyFirstAggregateId("a"));

            Assert.True(aggregate1.Equals(aggregate2));
        }
コード例 #3
0
ファイル: EqualityTests.cs プロジェクト: RossJayJones/ddd
        public void TheyShouldNotBeEqualWhenTheyHaveDifferentIdentity()
        {
            var aggregate1 = new MyFirstAggregate(new MyFirstAggregateId("a"));
            var aggregate2 = new MyFirstAggregate(new MyFirstAggregateId("b"));

            Assert.False(aggregate1.Equals(aggregate2));
        }