Ejemplo n.º 1
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"));
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 3
0
        public void AddItemArea()
        {
            Area area = new Area("Area 1");
            area.AddItem(new Area("Area 1a"));

            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.Area1.Count, Is.EqualTo(2));
            Assert.That(area.Area1[1].Name, Is.EqualTo("Area 1b"));
        }
Ejemplo n.º 4
0
        public void AddItemArea()
        {
            Area area = new Area("Area 1");

            area.AddItem(new Area("Area 1a"));

            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.Area1.Count, Is.EqualTo(2));
            Assert.That(area.Area1[1].Name, Is.EqualTo("Area 1b"));
        }
Ejemplo n.º 5
0
        public void AddItemWorkCentre()
        {
            Area area = new Area("Area 1");

            area.AddItem(new WorkCentre("Work Centre 1"));

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

            area.AddItem(new WorkCentre("Work Centre 2"));

            Assert.That(area.WorkCentre.Count, Is.EqualTo(2));
            Assert.That(area.WorkCentre[1].Name, Is.EqualTo("Work Centre 2"));
        }
Ejemplo n.º 6
0
        public void AddItemWorkCentre()
        {
            Area area = new Area("Area 1");
            area.AddItem(new WorkCentre("Work Centre 1"));

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

            area.AddItem(new WorkCentre("Work Centre 2"));

            Assert.That(area.WorkCentre.Count, Is.EqualTo(2));
            Assert.That(area.WorkCentre[1].Name, Is.EqualTo("Work Centre 2"));
        }
Ejemplo n.º 7
0
 public void AddItemSite()
 {
     Area area = new Area("Area 1");
     Assert.Throws<ArgumentException>(() => area.AddItem(new Site("Site 2")));
 }
Ejemplo n.º 8
0
 public void AddItemNull()
 {
     Area area = new Area("Area 1");
     Assert.Throws<ArgumentNullException>(() => area.AddItem(null));
 }
Ejemplo n.º 9
0
 public void AddItemEnterprise()
 {
     Area area = new Area("Area 1");
     Assert.Throws<ArgumentException>(() => area.AddItem(new Enterprise("My Enterprise")));
 }
Ejemplo n.º 10
0
        public void AddItemSite()
        {
            Area area = new Area("Area 1");

            Assert.Throws <ArgumentException>(() => area.AddItem(new Site("Site 2")));
        }
Ejemplo n.º 11
0
        public void AddItemNull()
        {
            Area area = new Area("Area 1");

            Assert.Throws <ArgumentNullException>(() => area.AddItem(null));
        }
Ejemplo n.º 12
0
        public void AddItemEnterprise()
        {
            Area area = new Area("Area 1");

            Assert.Throws <ArgumentException>(() => area.AddItem(new Enterprise("My Enterprise")));
        }