コード例 #1
0
        public void should_be_equal_with_null_id()
        {
            var left  = new UnitInfo(null, "token");
            var right = new UnitInfo(null, "token");

            Equals(left, right).Should().BeTrue();
            Equals(right, left).Should().BeTrue();

            left.Matches(right).Should().BeTrue();
            right.Matches(left).Should().BeTrue();
        }
コード例 #2
0
        public void should_not_be_equal_if_id_differs([Values(null, "token")] object token)
        {
            var left  = new UnitInfo("id1", token);
            var right = new UnitInfo("id2", token);

            Equals(left, right).Should().BeFalse();
            Equals(right, left).Should().BeFalse();

            left.Matches(right).Should().BeFalse();
            right.Matches(left).Should().BeFalse();
        }
コード例 #3
0
        public void should_not_be_equal_if_token_differs([Values(null, "id")] object id)
        {
            var left  = new UnitInfo(id, "token1");
            var right = new UnitInfo(id, "token2");

            Equals(left, right).Should().BeFalse();
            Equals(right, left).Should().BeFalse();

            left.Matches(right).Should().BeFalse();
            right.Matches(left).Should().BeFalse();
        }
コード例 #4
0
        public void should_not_be_equal_if_token_any_provided()
        {
            var left  = new UnitInfo(null, "token");
            var right = new UnitInfo(null, Token.Any);

            Equals(left, right).Should().BeFalse();
            Equals(right, left).Should().BeFalse();

            left.Matches(right).Should().BeTrue();
            right.Matches(left).Should().BeTrue();
        }