public void PostAdministratorInvalidReturnsError400()
        {
            AdministratorModel.Email = "bad email";
            var administrator = AdministratorModel.ToEntity();

            var administratorLogicMock = new Mock <IAdministratorLogic>(MockBehavior.Strict);

            administratorLogicMock.Setup(m => m.Create(administrator)).Returns(administrator);
            var administratorController = new AdministratorController(administratorLogicMock.Object);

            var result = administratorController.Post(AdministratorModel) as BadRequestObjectResult;

            Assert.AreEqual(result.StatusCode, 400);
        }
        public void PostAdministratorHas201StatusCode()
        {
            var administrator = AdministratorModel.ToEntity();

            var administratorLogicMock = new Mock <IAdministratorLogic>(MockBehavior.Strict);

            administratorLogicMock.Setup(m => m.Create(administrator)).Returns(administrator);
            var administratorController = new AdministratorController(administratorLogicMock.Object);

            var result = administratorController.Post(AdministratorModel) as CreatedResult;

            administratorLogicMock.VerifyAll();
            Assert.AreEqual(result.StatusCode, 201);
        }
        public void PostAdministratorReturnsValidModel()
        {
            var administrator = AdministratorModel.ToEntity();

            var administratorLogicMock = new Mock <IAdministratorLogic>(MockBehavior.Strict);

            administratorLogicMock.Setup(m => m.Create(administrator)).Returns(administrator);
            var administratorController = new AdministratorController(administratorLogicMock.Object);

            var result  = administratorController.Post(AdministratorModel) as CreatedResult;
            var content = result.Value as AdministratorBasicInfoModel;

            administratorLogicMock.VerifyAll();
            Assert.IsTrue(content.Equals(new AdministratorBasicInfoModel(administrator)));
        }