예제 #1
0
 static void Main(string[] args)
 {
     Network net = new Network("..\\..\\..\\test.txt", RandNext);
     net.Show();
     net.Step();
     net.Step();
     net.Step();
     net.Show();
     Console.ReadKey();
 }
예제 #2
0
 public void TestStep()
 {
     Network net = new Network("..\\..\\..\\test.txt", RandNext);
     net.Step();
     net.Step();
     net.Step();
     foreach (var x in net.ListOfComputers)
     {
         if (x.Virus)
             Console.Write("true ");
         else Console.Write("false ");
     }
     Assert.AreEqual(net.ListOfComputers[0].Virus, true);
     Assert.AreEqual(net.ListOfComputers[1].Virus, false);
     Assert.AreEqual(net.ListOfComputers[2].Virus, true);
     Assert.AreEqual(net.ListOfComputers[3].Virus, true);
     Assert.AreEqual(net.ListOfComputers[4].Virus, true);
 }