Exemplo n.º 1
0
        public void ConventionBasedStartup_GetConfigureMethod_NoMethodFoundThrows()
        {
            // Arrange
            var startup = new ConventionBasedStartup(new MyStartup6());

            // Act
            var ex = Assert.Throws <InvalidOperationException>(() => startup.GetConfigureMethod());

            // Assert
            Assert.Equal("The startup class must define a 'Configure' method.", ex.Message);
        }
Exemplo n.º 2
0
        public void ConventionBasedStartup_GetConfigureMethod_OverloadedThrows()
        {
            // Arrange
            var startup = new ConventionBasedStartup(new MyStartup7());

            // Act
            var ex = Assert.Throws <InvalidOperationException>(() => startup.GetConfigureMethod());

            // Assert
            Assert.Equal("Overloading the 'Configure' method is not supported.", ex.Message);
        }
Exemplo n.º 3
0
        public void ConventionBasedStartup_GetConfigureMethod_FindsConfigure()
        {
            // Arrange
            var startup = new ConventionBasedStartup(new MyStartup5());

            // Act
            var method = startup.GetConfigureMethod();

            // Assert
            Assert.Empty(method.GetParameters());
        }