public void EquipmentItem()
 {
     Equipment item = new Equipment();
     Assert.That(item.name, Is.EqualTo("Equipment"));
     Assert.That(item.id, Is.Null);
     Assert.That(item.Items, Is.Empty);
 }
        public void AddEquipmentItem()
        {
            Equipment site = new Equipment("Site");
            Equipment area = site.Items.AddEquipment("Area");

            Assert.That(area, Is.Not.Null);
            Assert.That(site.Items, Contains.Item(area));
            Assert.That(area.FullName, Is.EqualTo("Site.Area"));
        }
        public void FullName()
        {
            Equipment site = new Equipment {name = "Site A"};
            Equipment item = new Equipment {name = "Area 1"};

            Assert.That(site.FullName, Is.EqualTo("Site A"));
            Assert.That(item.FullName, Is.EqualTo("Area 1"));
            site.Items.Add(item);
            Assert.That(site.FullName, Is.EqualTo("Site A"));
            Assert.That(item.FullName, Is.EqualTo("Site A.Area 1"));
        }
        public void AddItemWorkCentre()
        {
            Equipment item = new Equipment("Item 1");
            item.AddItem(new Equipment("Work Centre 1"));

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

            item.AddItem(new Equipment("Work Centre 2"));

            Assert.That(item.Items.Count, Is.EqualTo(2));
            Assert.That(item.Items[1].Name, Is.EqualTo("Work Centre 2"));
        }
        public void AddItemEquipmentItem()
        {
            Equipment item = new Equipment("Item 1");
            item.AddItem(new Equipment("Item 1a"));

            Assert.That(item.Items.Count, Is.EqualTo(1));
            Assert.That(item.Items[0].Name, Is.EqualTo("Item 1a"));

            item.AddItem(new Equipment("Item 1b"));

            Assert.That(item.Items.Count, Is.EqualTo(2));
            Assert.That(item.Items[1].Name, Is.EqualTo("Item 1b"));
        }
 public void DefaultB2MMLType()
 {
     Equipment equipmentType = new Equipment();
     Assert.That(equipmentType.b2mmlType, Is.EqualTo(B2MMLType.Other));
 }
 public void AddItemSite()
 {
     Equipment item = new Equipment("Equipment 1");
     Assert.Throws<ArgumentException>(() => item.AddItem(new Site("Site 2")));
 }
 public void AddItemNull()
 {
     Equipment item = new Equipment("Item 1");
     Assert.Throws<ArgumentNullException>(() => item.AddItem(null));
 }
        public void DefaultB2MMLType()
        {
            Equipment equipmentType = new Equipment();

            Assert.That(equipmentType.b2mmlType, Is.EqualTo(B2MMLType.Other));
        }
Exemplo n.º 10
0
        public void TestToString()
        {
            Equipment item = new Equipment("My item");
            Assert.That(item.ToString(), Is.EqualTo("Equipment 'My item'"));

            item.Items.AddEquipment("Equipment 1");
            Assert.That(item.ToString(), Is.EqualTo("Equipment 'My item'"));

            item.Items.AddEquipment("Work Centre 1");
            Assert.That(item.ToString(), Is.EqualTo("Equipment 'My item'"));
        }
Exemplo n.º 11
0
 /// <summary>
 /// Adds an equipment item with the specified name
 /// </summary>
 /// <param name="name">The name.</param>
 /// <returns></returns>
 public Equipment AddEquipment(string name)
 {
     Equipment equipment = new Equipment(name);
     Add(equipment);
     return equipment;
 }
Exemplo n.º 12
0
        public void AddItemSite()
        {
            Equipment item = new Equipment("Equipment 1");

            Assert.Throws <ArgumentException>(() => item.AddItem(new Site("Site 2")));
        }
Exemplo n.º 13
0
        public void AddItemNull()
        {
            Equipment item = new Equipment("Item 1");

            Assert.Throws <ArgumentNullException>(() => item.AddItem(null));
        }
Exemplo n.º 14
0
        public void AddItemEnterprise()
        {
            Equipment item = new Equipment("Item 1");

            Assert.Throws <ArgumentException>(() => item.AddItem(new Enterprise("My Enterprise")));
        }
Exemplo n.º 15
0
        public void ItemCollection()
        {
            Equipment item = new Equipment();

            Assert.That(item.Items, Is.InstanceOf <ItemCollection <Equipment> >());
        }
Exemplo n.º 16
0
 public void ItemCollection()
 {
     Equipment item = new Equipment();
     Assert.That(item.Items, Is.InstanceOf<ItemCollection<Equipment>>());
 }
Exemplo n.º 17
0
 public void AddItemEnterprise()
 {
     Equipment item = new Equipment("Item 1");
     Assert.Throws<ArgumentException>(() => item.AddItem(new Enterprise("My Enterprise")));
 }