예제 #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);
        }
예제 #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);
        }
예제 #3
0
        public void ConventionBasedStartup_GetConfigureMethod_FindsConfigure()
        {
            // Arrange
            var startup = new ConventionBasedStartup(new MyStartup5());

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

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