public void PortalInstruction_IncompleteInsructionFromString_ThrowsArgumentException() { ExceptionAssert.Throws <ArgumentException>(() => PortalInstruction.FromString("")); ExceptionAssert.Throws <ArgumentException>(() => PortalInstruction.FromString("Portal-Door:")); ExceptionAssert.Throws <ArgumentException>(() => PortalInstruction.FromString("Portal-Door: (1,1,D)")); ExceptionAssert.Throws <ArgumentException>(() => PortalInstruction.FromString("Portal- End1")); ExceptionAssert.Throws <ArgumentException>(() => PortalInstruction.FromString("Portal- End2")); ExceptionAssert.Throws <ArgumentException>(() => PortalInstruction.FromString("End1 End2")); }
public void PortalInstruction_OffMapEndpointFromString_IsCorrect() { var portal = PortalInstruction.FromString("Portal-Door: (1,1,1); End1=(1,2,0); End2=(OffMap)"); Assert.AreEqual("Door", portal.Type); Assert.AreEqual(XYZOrientation.FromString("1,1,1,U"), portal.Location); Assert.AreEqual(new XYZ(1, 2, 0), portal.Endpoint1); Assert.AreEqual(SpecialLocation.OffOfMap, portal.Endpoint2); }
public static FacilityObject Create(PortalInstruction inst) { var portal = GetContainer().Create(inst.Type); portal.Type = inst.Type; portal.Endpoint1 = inst.Endpoint1; portal.Endpoint2 = inst.Endpoint2; portal.Orientation = inst.Location.Orientation; return(portal); }