예제 #1
0
            public void LoadFromAssembly_checks_only_given_assembly_for_views()
            {
                var mockCache            = new Mock <IViewAssemblyCache>();
                var objectItemCollection = new ObjectItemCollection(mockCache.Object);

                objectItemCollection.LoadFromAssembly(typeof(object).Assembly);

                mockCache.Verify(m => m.CheckAssembly(typeof(object).Assembly, false), Times.Once());
            }
예제 #2
0
            public void LoadFromAssembly_does_not_perform_o_space_lookup_if_o_space_types_already_loaded()
            {
                var mockKnownAssemblies  = new Mock <KnownAssembliesSet>();
                var objectItemCollection = new ObjectItemCollection(new Mock <IViewAssemblyCache>().Object, mockKnownAssemblies.Object);

                objectItemCollection.OSpaceTypesLoaded = true;

                objectItemCollection.LoadFromAssembly(typeof(FactAttribute).Assembly);
                objectItemCollection.LoadFromAssembly(
                    typeof(FactAttribute).Assembly, new EdmItemCollection(Enumerable.Empty <XmlReader>()));
                objectItemCollection.LoadFromAssembly(
                    typeof(FactAttribute).Assembly, new EdmItemCollection(Enumerable.Empty <XmlReader>()), s => { });

                KnownAssemblyEntry _;

                mockKnownAssemblies.Verify(
                    m => m.TryGetKnownAssembly(It.IsAny <Assembly>(), It.IsAny <object>(), It.IsAny <EdmItemCollection>(), out _),
                    Times.Never());
            }
예제 #3
0
            public void LoadFromAssembly_three_arg_overload_checks_only_given_assembly_for_views()
            {
                var mockCache            = new Mock <IViewAssemblyCache>();
                var objectItemCollection = new ObjectItemCollection(mockCache.Object);

                objectItemCollection.LoadFromAssembly(
                    typeof(object).Assembly, new EdmItemCollection(Enumerable.Empty <XmlReader>()), s => { });

                mockCache.Verify(m => m.CheckAssembly(typeof(object).Assembly, false), Times.Once());
            }
예제 #4
0
            public void LoadFromAssembly_does_perform_o_space_lookup_if_o_space_types_not_already_loaded()
            {
                var mockKnownAssemblies  = new Mock <KnownAssembliesSet>();
                var objectItemCollection = new ObjectItemCollection(new Mock <IViewAssemblyCache>().Object, mockKnownAssemblies.Object);

                objectItemCollection.LoadFromAssembly(typeof(FactAttribute).Assembly);

                KnownAssemblyEntry _;

                mockKnownAssemblies.Verify(
                    m => m.TryGetKnownAssembly(typeof(FactAttribute).Assembly, It.IsAny <object>(), It.IsAny <EdmItemCollection>(), out _));
            }
            public void Three_arg_LoadFromAssembly_does_perform_o_space_lookup_if_o_space_types_not_already_loaded()
            {
                var mockKnownAssemblies  = new Mock <KnownAssembliesSet>();
                var objectItemCollection = new ObjectItemCollection(mockKnownAssemblies.Object);

                objectItemCollection.LoadFromAssembly(
                    typeof(FactAttribute).Assembly, new EdmItemCollection(Enumerable.Empty <XmlReader>()), s => { });

                KnownAssemblyEntry _;

                mockKnownAssemblies.Verify(
                    m => m.TryGetKnownAssembly(typeof(FactAttribute).Assembly, It.IsAny <object>(), It.IsAny <EdmItemCollection>(), out _));
            }