Beispiel #1
0
        public void DeleteText_ExpectedParameters_Ok()
        {
            mockTextBusinessLogic.Setup(b1 => b1.DeleteText(text.Id));
            IHttpActionResult statusObtained = textController.Delete(text.Id);

            Assert.IsNotNull(statusObtained as OkNegotiatedContentResult <string>);
        }
Beispiel #2
0
        public void IntegrationTest_ExpectedParameters_Ok()
        {
            var requestMessage = new HttpRequestMessage();
            ITextBusinessLogic          textBL = new TextBusinessLogic(new TextDataAccess());
            IUserDataAccess             userDa = new UserDataAccess();
            IAuthorizationBusinessLogic auth   = new AuthorizationBusinessLogic(userDa);
            IAuditLogBussinesLogic      audit  = new AuditLogBussinesLogic();
            TextController textC = new TextController(textBL, auth, audit);

            textC.Request = requestMessage;
            TextModel text2 = TextModel.ToModel(Utils.CreateTextForTest());

            textC.Post(textModel);
            textC.Post(text2);
            text2.TextContent = "modified";
            textC.Put(text2.Id, text2);
            textC.Delete(textModel.Id);
            IHttpActionResult statusObtained = textC.Get();
        }