예제 #1
0
        public void PutEmployeeThrowsWhenRepositoryUpdateReturnsFalse()
        {
            //Arrange
            var controller = new EmployeeWCFController(new MemeoryEmployeeBoService());

            Assert.Throws<HttpResponseException>(() => controller.PutEmployee(new Employee() { EmployeeID=123}));
        }
예제 #2
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);
        }