Ejemplo n.º 1
0
        public void GetEmployeeShouldGetOneEntity()
        {
            var emploeeController = new EmployeeWCFController(new MemeoryEmployeeBoService());
            var item = emploeeController.GetEmployee(1);

            Assert.NotNull(item);
            Assert.IsType <Employee>(item);
        }
Ejemplo n.º 2
0
        public void GetEmployeeReturnsCorrectItemFromRepository()
        {
            // Arrange
            var product = new Employee {
                EmployeeID = 1, Title = "SD"
            };
            var controller = new EmployeeWCFController(new MemeoryEmployeeBoService());

            // Act
            var result = controller.GetEmployee(1);

            // Assert
            Assert.Equal(product.EmployeeID, result.EmployeeID);
        }
Ejemplo n.º 3
0
        public void PutEmployeeUpdatesRepository()
        {
            //Arrange
            var controller = new EmployeeWCFController(new MemeoryEmployeeBoService());
            var item       = new Employee {
                EmployeeID = 1, Title = "PM"
            };

            // Act
            controller.PutEmployee(item);
            var existEmployee = controller.GetEmployee(1);

            // Assert
            Assert.NotNull(existEmployee);
            Assert.Same(item, existEmployee);
        }
Ejemplo n.º 4
0
        public void GetProductThrowsWhenRepositoryReturnsNull()
        {
            var controller = new EmployeeWCFController(new MemeoryEmployeeBoService());

            Assert.Throws <HttpResponseException>(() => controller.GetEmployee(222));
        }