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")); }
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")); }
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")); }
public void AddItemSite() { Area area = new Area("Area 1"); Assert.Throws<ArgumentException>(() => area.AddItem(new Site("Site 2"))); }
public void AddItemNull() { Area area = new Area("Area 1"); Assert.Throws<ArgumentNullException>(() => area.AddItem(null)); }
public void AddItemEnterprise() { Area area = new Area("Area 1"); Assert.Throws<ArgumentException>(() => area.AddItem(new Enterprise("My Enterprise"))); }
public void AddItemSite() { Area area = new Area("Area 1"); Assert.Throws <ArgumentException>(() => area.AddItem(new Site("Site 2"))); }
public void AddItemNull() { Area area = new Area("Area 1"); Assert.Throws <ArgumentNullException>(() => area.AddItem(null)); }
public void AddItemEnterprise() { Area area = new Area("Area 1"); Assert.Throws <ArgumentException>(() => area.AddItem(new Enterprise("My Enterprise"))); }