Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }