public void Constructor_CreateViewModel_CheckProperties1()
        {
            var machine = new MachineMock();
            var product = new ProductMock();

            var vm = new MachineViewModel(machine);

            vm.AddProduct(product);

            Assert.AreEqual(vm.ProductViewModels.Count(), 1);
        }
        public void Constructor_CreateViewModel_CheckProperties()
        {
            var product = new ProductMock();

            var vm = new ProductViewModel(product);

            Assert.AreEqual(vm.ProductId, ProductMock.ID);
            Assert.AreEqual(vm.CustomerProductId, ProductMock.CID);
            Assert.AreEqual(vm.MachinePosX, ProductMock.POS_X, 1e-5);
            Assert.AreEqual(vm.MachinePosY, ProductMock.POS_Y, 1e-5);
            Assert.AreEqual(vm.ProductState, ProductMock.STATE);
        }
Beispiel #3
0
        public void AddProduct_CreateMachine_ValidateProducts()
        {
            int    capacity = 2;
            double length   = 2.0;
            double width    = 1.0;
            var    machine  = new MachineData(length, width, capacity);
            var    prod1    = new ProductMock();
            var    prod2    = new ProductMock();

            machine
            .AddProduct(prod1)
            .AddProduct(prod2);

            Assert.AreEqual(machine.Products.Count(), 2);
            Assert.AreSame(machine.Products.ElementAt(0), prod1);
            Assert.AreSame(machine.Products.ElementAt(1), prod2);
            Assert.IsTrue(machine.IsFull);
        }