public void AddItemBothAreaAndWorkCentre()
        {
            Area area = new Area("Area 1");

            Assert.That(area.GetCount(), Is.EqualTo(1));

            area.AddItem(new WorkCentre("Work Centre 1"));
            Assert.That(area.GetCount(), Is.EqualTo(2));

            Assert.That(area.WorkCentre.Count, Is.EqualTo(1));
            Assert.That(area.WorkCentre[0].Name, Is.EqualTo("Work Centre 1"));

            area.AddItem(new Area("Area 1a"));
            Assert.That(area.GetCount(), Is.EqualTo(3));

            Assert.That(area.Area1.Count, Is.EqualTo(1));
            Assert.That(area.Area1[0].Name, Is.EqualTo("Area 1a"));

            area.AddItem(new Area("Area 1b"));
            Assert.That(area.GetCount(), Is.EqualTo(4));

            Assert.That(area.Area1.Count, Is.EqualTo(2));
            Assert.That(area.Area1[1].Name, Is.EqualTo("Area 1b"));

            area.AddItem(new WorkCentre("Work Centre 2"));
            Assert.That(area.GetCount(), Is.EqualTo(5));

            Assert.That(area.WorkCentre.Count, Is.EqualTo(2));
            Assert.That(area.WorkCentre[1].Name, Is.EqualTo("Work Centre 2"));
        }
Beispiel #2
0
        public void AddItemBothAreaAndWorkCentre()
        {
            Area area = new Area("Area 1");

            Assert.That(area.GetCount(), Is.EqualTo(1));

            area.AddItem(new WorkCentre("Work Centre 1"));
            Assert.That(area.GetCount(), Is.EqualTo(2));

            Assert.That(area.WorkCentre.Count, Is.EqualTo(1));
            Assert.That(area.WorkCentre[0].Name, Is.EqualTo("Work Centre 1"));

            area.AddItem(new Area("Area 1a"));
            Assert.That(area.GetCount(), Is.EqualTo(3));

            Assert.That(area.Area1.Count, Is.EqualTo(1));
            Assert.That(area.Area1[0].Name, Is.EqualTo("Area 1a"));

            area.AddItem(new Area("Area 1b"));
            Assert.That(area.GetCount(), Is.EqualTo(4));

            Assert.That(area.Area1.Count, Is.EqualTo(2));
            Assert.That(area.Area1[1].Name, Is.EqualTo("Area 1b"));

            area.AddItem(new WorkCentre("Work Centre 2"));
            Assert.That(area.GetCount(), Is.EqualTo(5));

            Assert.That(area.WorkCentre.Count, Is.EqualTo(2));
            Assert.That(area.WorkCentre[1].Name, Is.EqualTo("Work Centre 2"));
        }