Exemplo n.º 1
0
        public void Civic_ParseToString()
        {
            String exp = Civic.TYPE + ":" + "3:False:6:3";

            String[] elems  = civ.ParseToString().Split(':');
            String   result = elems[0];

            for (int i = 1; i < elems.Length - 1; i++)
            {
                result += ':' + elems[i];
            }

            Assert.AreEqual(exp, result, "Strings should match");
        }
Exemplo n.º 2
0
        public void Setup()
        {
            Residential res;
            Commercial  com;
            Civic       civ;

            lm  = new LocationModel();
            dl1 = new DummyLocation(1);
            dl2 = new DummyLocation(2);
            dl3 = new DummyLocation(3);
            dl4 = new DummyLocation(4);

            dlList = new List <DummyLocation>();
            dlList.Add(dl1);
            dlList.Add(dl2);
            dlList.Add(dl3);
            dlList.Add(dl4);
            //connected = lm.ConnectDummyLocations(dlList);

            res = new Residential(1, 3, 5);
            com = new Commercial(2, 4, 7);
            civ = new Civic(3, 6, 3);

            validLoc.Add(new Tuple <String, String>("Type:Location,ID:1,Visited:True,Sublocations,CurrentSublocation", "Standard location is valid"));
            validLoc.Add(new Tuple <String, String>("Type:Location,ID:2,Visited:True,Sublocations:" + res.ParseToString() + ":" + com.ParseToString() + ",CurrentSublocation:1", "Standard location is valid"));
            validLoc.Add(new Tuple <String, String>("Type:Location,ID:3,Visited:True,Sublocations:" + res.ParseToString() + ":" + civ.ParseToString() + ":" + com.ParseToString() + ",CurrentSublocation:1", "Standard location is valid"));

            validDummy.Add(new Tuple <String, String>("Type:DummyLocation,ID:4", "Standard dummy location is valid"));
            validDummy.Add(new Tuple <String, String>("Type:DummyLocation,ID:5", "Standard dummy location is valid"));
            validDummy.Add(new Tuple <String, String>("Type:DummyLocation,ID:6", "Standard dummy location is valid"));
            validDummy.Add(new Tuple <String, String>("Type:DummyLocation,ID:7", "Standard dummy location is valid"));
            validDummy.Add(new Tuple <String, String>("Type:DummyLocation,ID:8", "Standard dummy location is valid"));
        }