From f6264d909868d2e944d24f3540d548fb592ef756 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Thu, 3 May 2018 10:58:53 -0500 Subject: [PATCH] Start of a system for regression testing. --- EduNetworkBuilder/ActionClass.cs | 55 ++++++++++++++++++++++ EduNetworkBuilder/EduNetworkBuilder.csproj | 1 + EduNetworkBuilder/NB.cs | 1 + 3 files changed, 57 insertions(+) create mode 100644 EduNetworkBuilder/ActionClass.cs diff --git a/EduNetworkBuilder/ActionClass.cs b/EduNetworkBuilder/ActionClass.cs new file mode 100644 index 0000000..9a14279 --- /dev/null +++ b/EduNetworkBuilder/ActionClass.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Drawing; + +namespace EduNetworkBuilder +{ + public class ActionCollection + { + Network StartingState = null; + public List NetActions = new List(); + + public void RegisterNet(Network starting) + { + //Get name from network + //See if that + } + /// + /// Return true if we already have a solved state for this network + /// + /// + /// + public bool AlreadyHaveNet(Network starting) + { + //Look up the network to see if we have it already + return AlreadyHaveNet(starting.PuzzleName); + } + public bool AlreadyHaveNet(string starting) + { + //Look up the network to see if we have it already + foreach(NetworkAction NA in NetActions) + { + if (NA.NetworkName == starting) return true; + } + return false; + } + } + + public class NetworkAction + { + public string NetworkName = ""; + public List Actions = new List(); + } + + public class ActionClass + { + public int SourceID = -1; + public int DestID = -1; + public Point Location; + public NetworkComponentType newItemType = NetworkComponentType.none; + public NetworkDevice ChangedDevice = null; + } +} diff --git a/EduNetworkBuilder/EduNetworkBuilder.csproj b/EduNetworkBuilder/EduNetworkBuilder.csproj index a987a7a..c05abc9 100644 --- a/EduNetworkBuilder/EduNetworkBuilder.csproj +++ b/EduNetworkBuilder/EduNetworkBuilder.csproj @@ -84,6 +84,7 @@ + Form diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs index fab11d6..eeea095 100644 --- a/EduNetworkBuilder/NB.cs +++ b/EduNetworkBuilder/NB.cs @@ -104,6 +104,7 @@ namespace EduNetworkBuilder public enum HowToBreak { PowerOff, EthernetBreak, EthernetCorrupt, EthernetRemoveLink, LockOutSwitch, WirelessBreakSSID, WirelessBreakKey, DeviceChangeIP, DeviceChangeGW, StaticRouteClear, StaticRouteCorrupt, VLANChange, VPNChangeEndpoint, VPNChangeKey, BreakDevice } + public enum NBAction { none, newdevice, changelocation, changedevice, deletecomponent, ping, traceroute, arp, dhcp } [Serializable] public struct HostNicID //This holds a unique identifier for a network card. Links use this to know what it is connected to