Start of a system for regression testing.
This commit is contained in:
parent
d045738205
commit
f6264d9098
55
EduNetworkBuilder/ActionClass.cs
Normal file
55
EduNetworkBuilder/ActionClass.cs
Normal file
@ -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<NetworkAction> NetActions = new List<NetworkAction>();
|
||||||
|
|
||||||
|
public void RegisterNet(Network starting)
|
||||||
|
{
|
||||||
|
//Get name from network
|
||||||
|
//See if that
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Return true if we already have a solved state for this network
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="starting"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
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<ActionClass> Actions = new List<ActionClass>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ActionClass
|
||||||
|
{
|
||||||
|
public int SourceID = -1;
|
||||||
|
public int DestID = -1;
|
||||||
|
public Point Location;
|
||||||
|
public NetworkComponentType newItemType = NetworkComponentType.none;
|
||||||
|
public NetworkDevice ChangedDevice = null;
|
||||||
|
}
|
||||||
|
}
|
@ -84,6 +84,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="ActionClass.cs" />
|
||||||
<Compile Include="AnimationClass.cs" />
|
<Compile Include="AnimationClass.cs" />
|
||||||
<Compile Include="DeviceConfig.cs">
|
<Compile Include="DeviceConfig.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
|
@ -104,6 +104,7 @@ namespace EduNetworkBuilder
|
|||||||
public enum HowToBreak { PowerOff, EthernetBreak, EthernetCorrupt, EthernetRemoveLink, LockOutSwitch,
|
public enum HowToBreak { PowerOff, EthernetBreak, EthernetCorrupt, EthernetRemoveLink, LockOutSwitch,
|
||||||
WirelessBreakSSID, WirelessBreakKey, DeviceChangeIP, DeviceChangeGW, StaticRouteClear,
|
WirelessBreakSSID, WirelessBreakKey, DeviceChangeIP, DeviceChangeGW, StaticRouteClear,
|
||||||
StaticRouteCorrupt, VLANChange, VPNChangeEndpoint, VPNChangeKey, BreakDevice }
|
StaticRouteCorrupt, VLANChange, VPNChangeEndpoint, VPNChangeKey, BreakDevice }
|
||||||
|
public enum NBAction { none, newdevice, changelocation, changedevice, deletecomponent, ping, traceroute, arp, dhcp }
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public struct HostNicID //This holds a unique identifier for a network card. Links use this to know what it is connected to
|
public struct HostNicID //This holds a unique identifier for a network card. Links use this to know what it is connected to
|
||||||
|
Loading…
Reference in New Issue
Block a user