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); }
public void GenericMethodsCanCoexistAndAreIgnored() { MethodBase method = ApplicationChooser.GetEntryPoint(typeof(TypeWithMainMethodsOverloadedByTypeParameterNumber)); Assert.IsNotNull(method); Assert.IsFalse(method.IsGenericMethod); Assert.IsFalse(method.IsGenericMethodDefinition); }
static void Main(string[] args) { DirectoryInfo dir = new DirectoryInfo(Application.ExecutablePath); // Navigate all the way up to the top of the example code tree dir = dir.Parent.Parent.Parent.Parent.Parent; string databasesDirectory = Path.Combine(dir.FullName, "Databases"); AppDomain.CurrentDomain.SetData("DataDirectory", databasesDirectory); ApplicationChooser.Run(typeof(Program), args); }
static void Main(string[] args) => ApplicationChooser.Run();
static void Main(string[] args) { ApplicationChooser.Run(typeof(Program), args); }
static void Main(string[] args) { //DirectoryInfo dir = new DirectoryInfo(Application.ExecutablePath); ApplicationChooser.Run(typeof(Program), args); }
static void Main() => ApplicationChooser.Run();
private static void Main(string[] args) { ApplicationChooser.Run(typeof(ProgramSelector), args); }
public void MethodCannotTakeOtherParameters() { Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(MainMethodWithInt32Parameter))); }
public void MethodCannotBeGeneric() { Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(TypeWithGenericMainMethod))); }
public void TypeCannotBeClosedGeneric() { Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(GenericTypeWithMainMethod <int>))); }
public void MainMethodCannotHaveStringArrayParameterByRef() { Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(MainMethodWithStringArrayParameterByRef))); }
public void BothMethodAndTypeCanBePublic() { Assert.IsNotNull(ApplicationChooser.GetEntryPoint(typeof(PublicClassAndPublicMainMethod))); }
public void NoMainMethodTypeIsRejected() { Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(NoMainMethod))); }