Esempio n. 1
0
        public void should_not_be_equal_if_type_differs([Values(null, "tag")] object tag)
        {
            var target1 = new IsInheritorOf(typeof(Stream), tag);
            var target2 = new IsInheritorOf(typeof(MemoryStream), tag);

            target1.Equals(target2).Should().BeFalse();
        }
Esempio n. 2
0
        public void should_not_match_not_inheritor([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(MemoryStream), tag);
            var target = new IsInheritorOf(typeof(IEnumerable), tag);

            target.Matches(unitId).Should().BeFalse();
        }
Esempio n. 3
0
        public void should_be_equal_if_fields_equal([Values(null, "tag")] object tag)
        {
            var target1 = new IsInheritorOf(typeof(Stream), tag);
            var target2 = new IsInheritorOf(typeof(Stream), tag);

            target1.Equals(target2).Should().BeTrue();
        }
Esempio n. 4
0
        public void should_match_any_tag_if_specified([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(MemoryStream), tag);
            var target = new IsInheritorOf(typeof(Stream), SpecialTag.Any);

            target.Matches(unitId).Should().BeTrue();
        }
Esempio n. 5
0
        public void should_match_value_type_as_inheritor_of_object([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(int), tag);
            var target = new IsInheritorOf(typeof(object), tag);

            target.Matches(unitId).Should().BeTrue();
        }
Esempio n. 6
0
        public void should_match_interface([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(MemoryStream), tag);
            var target = new IsInheritorOf(typeof(IDisposable), tag);

            target.Matches(unitId).Should().BeTrue();
        }
Esempio n. 7
0
        public void should_not_match_exact_type([Values(null, "tag")] object tag)
        {
            var unitId = new UnitId(typeof(Stream), tag);
            var target = new IsInheritorOf(typeof(Stream), tag);

            target.Matches(unitId).Should().BeFalse();
        }
Esempio n. 8
0
        public void should_not_match_if_tag_differs([Values(null, "unitTag")] object unitTag, [Values(null, "patternTag")] object?patternTag)
        {
            if (Equals(unitTag, patternTag))
            {
                Assert.Ignore("Not the case");
            }

            var unitId = new UnitId(typeof(MemoryStream), unitTag);
            var target = new IsInheritorOf(typeof(Stream), patternTag);

            target.Matches(unitId).Should().BeFalse();
        }