public void MWQMRunLanguageService_PostAddMWQMRunLanguageDB_MWQMRunModelOK_Error_Test() { foreach (CultureInfo culture in setupData.cultureListGood) { SetupTest(contactModelListGood[0], culture); using (TransactionScope ts = new TransactionScope()) { using (ShimsContext.Create()) { MWQMRunModel mwqmRunModelRet = mwqmRunServiceTest.AddMWQMRunModel(); LanguageEnum LangToAdd = LanguageEnum.es; FillMWQMRunLanguageModelNew(LangToAdd, mwqmRunModelRet, mwqmRunLanguageModelNew); string ErrorText = "ErrorText"; ShimMWQMRunLanguageService shimMWQMRunLanguageService = new ShimMWQMRunLanguageService(mwqmRunLanguageService); shimMWQMRunLanguageService.MWQMRunLanguageModelOKMWQMRunLanguageModel = (a) => { return(ErrorText); }; MWQMRunLanguageModel mwqmRunLanguageModelRet = mwqmRunLanguageService.PostAddMWQMRunLanguageDB(mwqmRunLanguageModelNew); Assert.AreEqual(ErrorText, mwqmRunLanguageModelRet.Error); } } } }
private void SetupShim() { shimMWQMRunLanguageService = new ShimMWQMRunLanguageService(mwqmRunLanguageService); }