Ejemplo n.º 1
0
        public void ValidCustomer()
        {
            // Arrange
            var custTest = new StoreApp.DataAccess.BusinessModels.Customer(1);

            custTest.FirstName = "Jordan";
            custTest.LastName  = "garcia";
            custTest.Phone     = "9992221111";

            // Act

            bool CustomerId = custTest.isValid();

            // Assert

            Assert.True(CustomerId);
        }
Ejemplo n.º 2
0
        public async Task Create_Customer()
        {
            // Arrange
            var mockRepo = new Mock <IRepository>();
            var custTest = new StoreApp.DataAccess.BusinessModels.Customer(1);

            custTest.FirstName = "Jordan";
            custTest.LastName  = "garcia";
            custTest.Phone     = "9992221111";
            var viewmodel  = new CustomerViewModel(custTest);
            var controller = new CustomersController(mockRepo.Object);

            // Act
            var result = await controller.Create(viewmodel);

            // Assert

            Assert.True(controller.ModelState.IsValid);
        }