コード例 #1
0
        public void AddStyleClassToFormat_ExpectedParameters_Ok()
        {
            mockFormatsBusinessLogic.Setup(b1 => b1.AddStyle(format.Id, styleClass));
            IHttpActionResult statusObtained = formatController.AddStyleClassToFormat(format.Id, StyleClassModel.ToModel(styleClass));

            Assert.IsNotNull(statusObtained as OkNegotiatedContentResult <string>);
        }
コード例 #2
0
        public void integration()
        {
            var                         requestMessage = new HttpRequestMessage();
            IUserDataAccess             da             = new UserDataAccess();
            IUserBusinessLogic          userBL         = new UserBusinessLogic(new UserDataAccess());
            IAuthorizationBusinessLogic auth           = new AuthorizationBusinessLogic(da);
            IStyleDataAccess            styleDA        = new StyleDataAccess();
            IStyleBusinessLogic         styleBL        = new StyleBusinessLogic(styleDA);
            IStyleClassDataAccess       styleClassDA   = new StyleClassDataAccess();
            IStyleClassBusinessLogic    styleClassBL   = new StyleClassBusinessLogic(styleClassDA, styleBL);
            IFormatDataAccess           formatDA       = new FormatDataAccess();
            IFormatBusinessLogic        formatBL       = new FormatBusinessLogic(formatDA, styleClassBL);
            FormatController            formatC        = new FormatController(formatBL, auth);

            formatC.Request = requestMessage;
            StyleClass  styleClassA  = Utils.CreateStyleClassInDataBaseForTest();
            Format      formatA      = Utils.CreateFormatForTest();
            FormatModel formatModelA = FormatModel.ToModel(formatA);

            formatC.Post(formatModelA);
            formatC.AddStyleClassToFormat(formatA.Id, StyleClassModel.ToModel(styleClassA));
            IHttpActionResult statusObtained = formatC.Get(formatA.Id);
            int a = 2;
        }