public void CheckExampleModule() { var module = new ExampleModule(Context); Assert.IsNotNull(module.Manager); Assert.IsNotNull(module.RequestManager); }
private static void InitializeDIContainer() { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json"); configuration = builder.Build(); var module = new ExampleModule(services, configuration); }
public void OnInitialized_DoesNotThrowError_WhenCalled() { // Arrange var mockContainer = new Mock <IContainerProvider>(); IModule module = new ExampleModule(); // Act var ex = Record.Exception(() => module.OnInitialized(mockContainer.Object)); // Assert Assert.Null(ex); }
public void RegisterTypes_RegistersExampleModulePage_WhenCalled() { // Arrange var mockRegistry = new Mock <IContainerRegistry>(); // The RegisterForNavigation is an extension method so to test it we check that it calls through to Register(Type, Type, string) mockRegistry.Setup(r => r.Register(typeof(object), typeof(ExampleModulePage), It.IsAny <string>())); IModule module = new ExampleModule(); // Act module.RegisterTypes(mockRegistry.Object); // Assert mockRegistry.Verify(r => r.Register(typeof(object), typeof(ExampleModulePage), It.IsAny <string>()), Times.Once); }
private void ConfigureIoC(IServiceCollection services) { var module = new ExampleModule(services, Configuration); }
public void Module_registers_two_routes() { var m = new ExampleModule(); Assert.Equal(2, m.Routes.Count); }