Beispiel #1
0
        public void Models_ShopTruckFullModel_Default_Instantiate_Get_Set_Should_Pass()
        {
            // Arange

            // Act
            var result = new ShopTruckFullModel();

            // Reset
            DataSourceBackend.Instance.Reset();

            // Assert
            Assert.IsNotNull(result, TestContext.TestName);

            Assert.IsNotNull(result.Truck, "Truck " + TestContext.TestName);
            Assert.IsNotNull(result.Menu, "Menu " + TestContext.TestName);
            Assert.IsNotNull(result.Sign, "Sign " + TestContext.TestName);
            Assert.IsNotNull(result.Trailer, "Trailer " + TestContext.TestName);
            Assert.IsNotNull(result.Topper, "Topper " + TestContext.TestName);
            Assert.IsNotNull(result.Wheels, "Wheels " + TestContext.TestName);
            Assert.IsNotNull(result.IsClosed, "Closed " + TestContext.TestName);
            Assert.IsNotNull(result.CustomersTotal, "Customers" + TestContext.TestName);
            Assert.IsNotNull(result.TransactionList, "TransactionList" + TestContext.TestName);
            Assert.IsNotNull(result.TruckName, "TruckName" + TestContext.TestName);
            Assert.IsNotNull(result.Income, "Income" + TestContext.TestName);
            Assert.IsNotNull(result.Outcome, "Outcome" + TestContext.TestName);
            Assert.IsNotNull(result.BusinessList, "BusinessList" + TestContext.TestName);

            Assert.IsNotNull(result.TruckUri, "TruckUri " + TestContext.TestName);
            Assert.IsNotNull(result.MenuUri, "MenuUri " + TestContext.TestName);
            Assert.IsNotNull(result.SignUri, "SignUri " + TestContext.TestName);
            Assert.IsNotNull(result.TrailerUri, "TrailerUri " + TestContext.TestName);
            Assert.IsNotNull(result.TopperUri, "TopperUri " + TestContext.TestName);
            Assert.IsNotNull(result.WheelsUri, "WheelsUri " + TestContext.TestName);
            Assert.IsNotNull(result.Tokens, "Tokens " + TestContext.TestName);
            Assert.IsNotNull(result.Experience, "Experience " + TestContext.TestName);
            Assert.IsNotNull(result.IterationNumber, "IterationNumber " + TestContext.TestName);
        }
Beispiel #2
0
        /// <summary>
        /// Simulation Results
        /// </summary>
        public ShopTruckFullModel GetResult(string id = null)
        {
            // Get the Store results for this student
            // Return the Student Results
            var result = new ShopTruckFullModel();

            var StudentData = DataSourceBackend.Instance.StudentBackend.Read(id);

            if (StudentData == null)
            {
                return(result);
            }

            if (StudentData.Tokens < 1)
            {
                if (StudentData.Truck.IsClosed == false)
                {
                    StudentData.Truck.IsClosed = true;
                    DataSourceBackend.Instance.StudentBackend.Update(StudentData);
                }
            }

            result = StudentData.Truck;

            result.Tokens     = StudentData.Tokens;
            result.Experience = StudentData.ExperiencePoints;
            result.TruckName  = StudentData.Truck.TruckName;

            result.TransactionList = StudentData.Truck.TransactionList;

            result.IsClosed        = StudentData.Truck.IsClosed;
            result.IterationNumber = GetDefault().IterationNumber;
            result.CustomersTotal  = StudentData.Truck.CustomersTotal;

            return(result);
        }