Exemplo n.º 1
0
        public void Details_Get_Object()
        {
            // Act
            var actionResult = _customerAddressController.Details(1);
            var viewResult   = actionResult as ViewResult;
            var actual       = (CustomerAddress)viewResult.Model;

            // Assert
            Assert.AreEqual(ResourceData.CustomerAddresses[0].AddressId, actual.AddressId);
            Assert.AreEqual(1, actual.Id);
            Assert.AreEqual(ResourceData.CustomerAddresses[0].CustomerId, actual.CustomerId);
        }
Exemplo n.º 2
0
        public void Details_Customer()
        {
            var actionResult  = _customerController.Details(1);
            var actionResult2 = _customerAddressController.Details(1);
            var viewResult    = actionResult as ViewResult;
            var viewResult2   = actionResult2 as ViewResult;
            var customer      = (Customer)viewResult.Model;
            var adress        = (CustomerAddress)viewResult2.Model;

            Assert.AreEqual(1, customer.Id);
            Assert.AreEqual(1, adress.Id);
        }