Example #1
0
        public void TypesEnumeratedOnlyOnce([Frozen] IEntityTypesProvider decorated, CachedEntityTypesProvider sut)
        {
            IEnumerable <Type> typesFirst  = new[] { typeof(Foo), typeof(Bar) };
            IEnumerable <Type> typesSecond = new[] { typeof(Qux), typeof(object) };

            decorated.GetTypes().Returns(typesFirst, typesSecond);

            var resultFirst  = sut.GetTypes();
            var resultSecond = sut.GetTypes();

            resultSecond.Should().BeEquivalentTo(typesFirst)
            .And.BeEquivalentTo(resultFirst);
        }
        public void TypesEnumeratedOnlyOnce([Frozen] IEntityTypesProvider decorated, CachedEntityTypesProvider sut)
        {
            IEnumerable<Type> typesFirst = new[] { typeof(Foo), typeof(Bar) };
            IEnumerable<Type> typesSecond = new[] { typeof(Qux), typeof(object) };

            decorated.GetTypes().Returns(typesFirst, typesSecond);

            var resultFirst = sut.GetTypes();
            var resultSecond = sut.GetTypes();

            resultSecond.Should().BeEquivalentTo(typesFirst)
                .And.BeEquivalentTo(resultFirst);
        }
        public void SutIsDecorator([Frozen] IEntityTypesProvider decorated, CachedEntityTypesProvider sut)
        {
            var types = new[] { typeof (Foo), typeof (Bar), typeof (Qux) };
            decorated.GetTypes().Returns(types);

            var result = sut.GetTypes();

            result.Should().BeEquivalentTo(types);
        }
Example #4
0
        public void SutIsDecorator([Frozen] IEntityTypesProvider decorated, CachedEntityTypesProvider sut)
        {
            var types = new[] { typeof(Foo), typeof(Bar), typeof(Qux) };

            decorated.GetTypes().Returns(types);

            var result = sut.GetTypes();

            result.Should().BeEquivalentTo(types);
        }