Exemplo n.º 1
0
        public void CheckExampleModule()
        {
            var module = new ExampleModule(Context);

            Assert.IsNotNull(module.Manager);
            Assert.IsNotNull(module.RequestManager);
        }
Exemplo n.º 2
0
        private static void InitializeDIContainer()
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json");

            configuration = builder.Build();

            var module = new ExampleModule(services, configuration);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 private void ConfigureIoC(IServiceCollection services)
 {
     var module = new ExampleModule(services, Configuration);
 }
Exemplo n.º 6
0
        public void Module_registers_two_routes()
        {
            var m = new ExampleModule();

            Assert.Equal(2, m.Routes.Count);
        }