Exemplo n.º 1
0
 public void should_get_database()
 {
     var connection = Substitute.For<IConnection>();
     connection.ConnectionString.Returns("yada");
     var systeminfo = new SystemInfo(connection, Substitute.For<ILogger>());
     systeminfo.Database.ShouldEqual("yada");
 }
Exemplo n.º 2
0
 public void should_get_log_config()
 {
     var logger = Substitute.For<ILogger>();
     logger.Path.Returns("path");
     logger.Email.Returns("email");
     logger.SmtpServer.Returns("smtp");
     var systeminfo = new SystemInfo(Substitute.For<IConnection>(), logger);
     systeminfo.LogPath.ShouldEqual("path");
     systeminfo.ErrorEmail.ShouldEqual("email");
     systeminfo.ErrorEmailSmtp.ShouldEqual("smtp");
 }
Exemplo n.º 3
0
 public void should_get_webserver_name()
 {
     var systeminfo = new SystemInfo(Substitute.For<IConnection>(), Substitute.For<ILogger>());
     systeminfo.WebServer.ShouldEqual(Environment.MachineName);
 }
Exemplo n.º 4
0
 public void should_get_smtp_server_name()
 {
     var systeminfo = new SystemInfo(Substitute.For<IConnection>(), Substitute.For<ILogger>());
     systeminfo.SmtpServer.ShouldEqual(new System.Net.Mail.SmtpClient().Host);
 }
Exemplo n.º 5
0
 public void should_get_assembly_version()
 {
     var systeminfo = new SystemInfo(Substitute.For<IConnection>(), Substitute.For<ILogger>());
     systeminfo.Version.ShouldEqual(_assembly.GetName().Version.ToString());
 }
Exemplo n.º 6
0
 public void should_get_assembly_timestamp()
 {
     var systeminfo = new SystemInfo(Substitute.For<IConnection>(), Substitute.For<ILogger>());
     systeminfo.BuildDate.ShouldEqual(File.GetLastWriteTime(_assembly.Location));
 }
Exemplo n.º 7
0
 public void should_get_assembly_mode()
 {
     var systeminfo = new SystemInfo(Substitute.For<IConnection>(), Substitute.For<ILogger>());
     systeminfo.DebugMode.ShouldEqual(_assembly.IsInDebugMode() ? SystemInfo.Mode.Debug : SystemInfo.Mode.Release);
 }