public void ImplicitLoadAssemblyForType_does_not_check_assembly_for_views_if_assembly_filtered() { var mockCache = new Mock <IViewAssemblyCache>(); var objectItemCollection = new ObjectItemCollection(mockCache.Object); objectItemCollection.ImplicitLoadAssemblyForType( typeof(object), new EdmItemCollection(Enumerable.Empty <XmlReader>())); mockCache.Verify(m => m.CheckAssembly(It.IsAny <Assembly>(), It.IsAny <bool>()), Times.Never()); }
public void ImplicitLoadAssemblyForType_checks_assemblies_of_generics_for_views_if_assembly_not_filtered() { var mockCache = new Mock <IViewAssemblyCache>(); var objectItemCollection = new ObjectItemCollection(mockCache.Object); objectItemCollection.ImplicitLoadAssemblyForType( typeof(Dictionary <FactAttribute, FactAttribute>), new EdmItemCollection(Enumerable.Empty <XmlReader>())); mockCache.Verify(m => m.CheckAssembly(typeof(FactAttribute).Assembly, false), Times.Exactly(2)); }
public void ImplicitLoadAssemblyForType_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.ImplicitLoadAssemblyForType( typeof(Dictionary <FactAttribute, FactAttribute>), new EdmItemCollection(Enumerable.Empty <XmlReader>())); KnownAssemblyEntry _; mockKnownAssemblies.Verify( m => m.TryGetKnownAssembly(typeof(FactAttribute).Assembly, It.IsAny <object>(), It.IsAny <EdmItemCollection>(), out _)); }
public void ImplicitLoadAssemblyForType_does_not_perform_o_space_lookup_if_o_space_types_already_loaded() { var mockKnownAssemblies = new Mock <KnownAssembliesSet>(); var objectItemCollection = new ObjectItemCollection(mockKnownAssemblies.Object); objectItemCollection.OSpaceTypesLoaded = true; objectItemCollection.ImplicitLoadAssemblyForType( typeof(Dictionary <FactAttribute, FactAttribute>), new EdmItemCollection(Enumerable.Empty <XmlReader>())); KnownAssemblyEntry _; mockKnownAssemblies.Verify( m => m.TryGetKnownAssembly(It.IsAny <Assembly>(), It.IsAny <object>(), It.IsAny <EdmItemCollection>(), out _), Times.Never()); }