/// <summary> /// Initializes a new instance of the <see cref="ServerForm"/> class. /// </summary> /// <param name="server">The server.</param> /// <param name="configuration">The configuration.</param> /// <param name="application">The application.</param> public ServerForm(StandardServer server, ApplicationConfiguration configuration, CASApplicationInstance application) { InitializeComponent(); m_application = application; m_server = server; this.ServerDiagnosticsCTRL.Initialize(m_server, configuration); ApplicationCertificate.DisplayUaTcpImplementation(x => this.Text = x, this.Text, configuration); m_server.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler(CertificateValidator_CertificateValidation); TrayIcon.Text = this.Text; }
public void CreatorTestTest() { CASApplicationInstance _instance = new CASApplicationInstance(); Assert.IsNull(_instance.ApplicationConfiguration); Assert.AreSame(typeof(CASConfiguration), _instance.ApplicationConfigurationType); Assert.AreEqual <string>(null, _instance.ApplicationName); Assert.AreEqual <ApplicationType>(ApplicationType.Server, _instance.ApplicationType); Assert.AreEqual <string>("CAS.UA.Server", _instance.ConfigSectionName); Assert.IsNull(_instance.InstallConfig); Assert.IsNull(_instance.Server); }
public void LoadApplicationConfigurationTest() { Debug.WriteLine(Environment.CurrentDirectory); FileInfo file = new FileInfo(Path.Combine(Environment.CurrentDirectory, @"EmbeddedExample\DemoConfiguration\BoilerExample.uasconfig")); Assert.IsTrue(file.Exists, $"Wrong deployment file doesn't exist {file.FullName}"); using (Main _main = new Main()) { CASApplicationInstance _instance = new CASApplicationInstance(); _instance.LoadApplicationConfiguration(true); Assert.IsNotNull(_instance.ApplicationConfiguration); Assert.IsInstanceOfType(_instance.ApplicationConfiguration, typeof(CASConfiguration)); Assert.AreSame(typeof(CASConfiguration), _instance.ApplicationConfigurationType); Assert.AreEqual <string>(null, _instance.ApplicationName); Assert.AreEqual <ApplicationType>(ApplicationType.Server, _instance.ApplicationType); Assert.AreEqual <string>("CAS.UA.Server", _instance.ConfigSectionName); Assert.IsNull(_instance.InstallConfig); Assert.IsNull(_instance.Server); } }
public void StartNullServerTest() { CASApplicationInstance _instance = new CASApplicationInstance(); _instance.Start(null); }