Exemplo n.º 1
0
 public void ItCanReadAPortAndDirectoryValue()
 {
     var input = new [] {"-p", "5050", "-d", @"\some\path\"};
     var testOptions = new InputOption(input);
     testOptions.Port.ShouldEqual(5050);
     testOptions.Directory.ShouldEqual(@"\some\path\");
 }
Exemplo n.º 2
0
 public void ItCanReadAPortValue()
 {
     var input = new [] {"-p", "5050"};
     var testOptions = new InputOption(input);
     testOptions.Port.ShouldEqual(5050);
     testOptions.Directory.ShouldEqual(_defaultDirectory);
 }
Exemplo n.º 3
0
 public void ItCanGiveDefaultValues()
 {
     var input = new string[] {};
     var testOptions = new InputOption(input);
     testOptions.Port.ShouldEqual(_defaultPort);
     testOptions.Directory.ShouldEqual(_defaultDirectory);
 }
Exemplo n.º 4
0
 private static void Main(string[] args)
 {
     var input = new InputOption(args);
     Environment.SetEnvironmentVariable("directory", input.Directory);
     Environment.SetEnvironmentVariable("port", input.Port.ToString());
     var server = new Server();
     server.AddRoutes(AppRoutes.Routes);
     server.StartListening(input.Port);
 }