public void DiscoverResources_Adds_Resources_From_Added_Assembly_To_Graph() { // Arrange ServiceDiscoveryFacade facade = new ServiceDiscoveryFacade(_services, _resourceGraphBuilder, _options, _loggerFactory); facade.AddAssembly(typeof(Person).Assembly); // Act facade.DiscoverResources(); // Assert var resourceGraph = _resourceGraphBuilder.Build(); var personResource = resourceGraph.GetResourceContext(typeof(Person)); var articleResource = resourceGraph.GetResourceContext(typeof(Article)); Assert.NotNull(personResource); Assert.NotNull(articleResource); }
public void Can_add_resources_from_assembly_to_graph() { // Arrange var facade = new ServiceDiscoveryFacade(_services, _resourceGraphBuilder, _options, _loggerFactory); facade.AddAssembly(typeof(Person).Assembly); // Act facade.DiscoverResources(); // Assert var resourceGraph = _resourceGraphBuilder.Build(); var personResource = resourceGraph.GetResourceContext(typeof(Person)); personResource.Should().NotBeNull(); var articleResource = resourceGraph.GetResourceContext(typeof(Article)); articleResource.Should().NotBeNull(); }
public void Can_add_resources_from_assembly_to_graph() { // Arrange var facade = new ServiceDiscoveryFacade(_services, _resourceGraphBuilder, _options, LoggerFactory); facade.AddAssembly(typeof(Person).Assembly); // Act facade.DiscoverResources(); // Assert IResourceGraph resourceGraph = _resourceGraphBuilder.Build(); ResourceContext personContext = resourceGraph.GetResourceContext(typeof(Person)); personContext.Should().NotBeNull(); ResourceContext todoItemContext = resourceGraph.GetResourceContext(typeof(TodoItem)); todoItemContext.Should().NotBeNull(); }