Exemple #1
0
        public void CreateAndUpdateProcedure()
        {
            // Arrange
            Token temp = new Token(10, 15);

            DocumentationCoordinationProcedure procedure1 = new DocumentationCoordinationProcedure();

            procedure1.AddToken(temp, 0);
            procedure1.AddResorce(new WorkerResource());
            procedure1.AddResorce(new CadResource());
            procedure1.AddResorce(new TechincalSupportResource());
            procedure1.Update(new ModelingTime());

            DocumentationCoordinationProcedure procedure2;

            // Act
            procedure2 = SaveTester <DocumentationCoordinationProcedure> .StartSaveTest(procedure1);

            // Asserts
            Assert.AreEqual((procedure1).Description, (procedure2).Description);
            Assert.AreEqual((procedure1).InputQuantity, (procedure2).InputQuantity);
            Assert.AreEqual((procedure1).OutputQuantity, (procedure2).OutputQuantity);
            Assert.AreEqual((procedure1).ResourceCount, (procedure2).ResourceCount);
            Assert.AreEqual((procedure1).TokenCollector, (procedure2).TokenCollector);
        }
Exemple #2
0
        public void UpdateWithResTest()
        {
            // arrange
            DocumentationCoordinationProcedure procedure = new DocumentationCoordinationProcedure();

            procedure.AddToken(new Token(bornTime: 0, complexity: 1000), 0);
            Token token = null;

            // act
            ModelingTime modelingTime = new ModelingTime()
            {
                Delta = 1, Now = 0
            };

            for (modelingTime.Now = 0; modelingTime.Now < 80 && token == null; modelingTime.Now += modelingTime.Delta)
            {
                procedure.Update(modelingTime);
                token = procedure.GetOutputToken(0);
                procedure.ClearOutputs();
            }

            // Asserts
            Assert.AreNotEqual(token, null);
            if (modelingTime.Now < 7 || modelingTime.Now > 61)
            {
                Assert.Fail();
            }
        }