Exemplo n.º 1
0
        public void GetExactComponent_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            HasComponents unitUnderTest = this.CreateHasComponents();

            // Act
            ComponentSelectable         result  = unitUnderTest.GetExactComponent <ComponentSelectable>();
            ComponentHarvestable        result2 = unitUnderTest.GetExactComponent <ComponentHarvestable>();
            DropWhenCompletelyHarvested result3 = unitUnderTest.GetExactComponent <DropWhenCompletelyHarvested>();

            // Assert
            Assert.IsNotNull(result);
            Assert.IsNull(result2);
            Assert.IsNotNull(result3);
        }
Exemplo n.º 2
0
        public void AddComponent_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            HasComponents unitUnderTest           = this.CreateHasComponents();
            DropWhenCompletelyHarvested component = new DropWhenCompletelyHarvested(new List <Item>(), "", "");

            // Act
            unitUnderTest.ClearComponents();
            unitUnderTest.AddComponent(component);

            // Assert
            Assert.IsTrue(unitUnderTest.HasComponent <DropWhenCompletelyHarvested>());
            Assert.IsTrue(unitUnderTest.GetExactComponent <DropWhenCompletelyHarvested>() != null);
            Assert.IsTrue(unitUnderTest.GetComponent <DropWhenCompletelyHarvested>() != null);
            Assert.IsTrue(unitUnderTest.GetComponent <ComponentHarvestable>() != null);
        }