コード例 #1
0
        public void MethodWithStringArrayParameterIsPreferredToMethodWithNoParameters()
        {
            MethodBase method = ApplicationChooser.GetEntryPoint(typeof(TypeHasMultipleMainMethods));

            Assert.IsNotNull(method);
            Assert.AreEqual(1, method.GetParameters().Length);
            Assert.AreEqual(typeof(string[]), method.GetParameters()[0].ParameterType);
        }
コード例 #2
0
        public void GenericMethodsCanCoexistAndAreIgnored()
        {
            MethodBase method = ApplicationChooser.GetEntryPoint(typeof(TypeWithMainMethodsOverloadedByTypeParameterNumber));

            Assert.IsNotNull(method);
            Assert.IsFalse(method.IsGenericMethod);
            Assert.IsFalse(method.IsGenericMethodDefinition);
        }
コード例 #3
0
 public void MethodCannotTakeOtherParameters()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(MainMethodWithInt32Parameter)));
 }
コード例 #4
0
 public void MethodCannotBeGeneric()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(TypeWithGenericMainMethod)));
 }
コード例 #5
0
 public void TypeCannotBeClosedGeneric()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(GenericTypeWithMainMethod <int>)));
 }
コード例 #6
0
 public void MainMethodCannotHaveStringArrayParameterByRef()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(MainMethodWithStringArrayParameterByRef)));
 }
コード例 #7
0
 public void BothMethodAndTypeCanBePublic()
 {
     Assert.IsNotNull(ApplicationChooser.GetEntryPoint(typeof(PublicClassAndPublicMainMethod)));
 }
コード例 #8
0
 public void NoMainMethodTypeIsRejected()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(NoMainMethod)));
 }