public void GetByIdTest()
        {
            var controller = new EmployeesApiController(CreateIQueriesMock(), CreateICommandBusMock());
            var result = controller.Get("1");

            Assert.IsNotNull(result);
        }
        public void GetTest()
        {
            var controller = new EmployeesApiController(CreateIQueriesMock(), CreateICommandBusMock());
            var result = controller.Get();

            Assert.IsNotNull(result);

            Assert.AreEqual(2, result.Count());
        }
        public void DeleteTest()
        {
            var cmdBus = new Mock<ICommandBus>();
            var controller = new EmployeesApiController(CreateIQueriesMock(), cmdBus.Object);

            controller.Delete("1");

            cmdBus.Verify(i => i.Execute(It.IsAny<MessageBase>()));
        }
        public void PostTest()
        {
            var cmdBus = new Mock<ICommandBus>();
            var controller = new EmployeesApiController(CreateIQueriesMock(), cmdBus.Object);
            var newEmp = CreateNewEmployeeDetailViewModel();

            var result = controller.Post(newEmp);

            Assert.IsNotNull(result);

            cmdBus.Verify(i => i.Execute(It.IsAny<MessageBase>()));
        }
        public void PutTest()
        {
            var cmdBus = new Mock<ICommandBus>();
            var controller = new EmployeesApiController(CreateIQueriesMock(), cmdBus.Object);
            var oldEmp = CreateExistingEmployeeDetailViewModel();

            controller.Put("1", oldEmp);

            cmdBus.Verify(i => i.Execute(It.IsAny<MessageBase>()));
        }