public static void LoadManagementSystemConfig(ManagementSystem management, String filename) { var jsonFile = File.ReadAllText(filename); ManagementModel managementModel = JsonSerializer.Deserialize <ManagementModel>(jsonFile); management.Name = managementModel.Name; management.ManagementSystemPoint = new IPEndPoint(IPAddress.Parse(managementModel.IpAddress), managementModel.Port); management.DevicesList = new Dictionary <String, String>(); foreach (NetworkNode element in managementModel.NetworkNodeList) { management.DevicesList.Add(element.NodeName, element.JsonFile); } management.AllDevicesList = new Dictionary <string, IPEndPoint>(); foreach (Device device in managementModel.DevicesList) { management.AllDevicesList.Add(device.name, new IPEndPoint(IPAddress.Parse(device.IPAddress), device.port)); } }
public void readRequestTest() { TextClear(); // Actual string firstName = "Taekyu"; // TODO: Initialize to an appropriate value string lastName = "Kim"; // TODO: Initialize to an appropriate value string request = "Fix"; // TODO: Initialize to an appropriate value string status = "Waiting"; // TODO: Initialize to an appropriate value string assignment = "Jhon"; // TODO: Initialize to an appropriate value double grade = 60; // TODO: Initialize to an appropriate value string actual = "Taekyu;Kim;Fix;Waiting;Jhon;60;"; RequestInformation ri = new RequestInformation(firstName, lastName, request, status, assignment, grade); ManagementSystem.ManagementSystem target = new ManagementSystem.ManagementSystem(); // TODO: Initialize to an appropriate value // Expected using (StreamWriter writer = new StreamWriter("../../Text/UnitTest.txt", true)) { writer.Write(ri.firstName + ";" + ri.lastName + ";" + ri.request + ";" + ri.status + ";" + ri.assignment + ";" + ri.grade + ";"); } using (StreamReader reader = new StreamReader("../../Text/UnitTest.txt")) { string expected = reader.ReadLine(); Assert.AreEqual(expected, actual); } }
static void Main(string[] args) { ManagementSystem ms = new ManagementSystem(args[0], args[1]); //MplsConfiguration mpls_config = new MplsConfiguration("..\\..\\..\\..\\Configs\\mpls_border_config.txt", "..\\..\\..\\..\\Configs\\mpls_config.txt"); Console.Title = "ManagementSystem"; ms.HandleNodes(); Console.ReadLine(); }
static void Main(string[] args) { string workingDirectory = Environment.CurrentDirectory; string R1Path = Path.Combine(workingDirectory, @"DataStructures", "R1_tables.properties"); string R2Path = Path.Combine(workingDirectory, @"DataStructures", "R2_tables.properties"); string R3Path = Path.Combine(workingDirectory, @"DataStructures", "R3_tables.properties"); string R4Path = Path.Combine(workingDirectory, @"DataStructures", "R4_tables.properties"); ManagementSystem managementSystem = new ManagementSystem(R1Path, R2Path, R3Path, R4Path); managementSystem.Start(); }