// GET: Edit public ActionResult Edit(int?id) { if (id is null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var service = CreateLanguageService(); var language = service.GetLanguageById((int)id); if (language is null) { return(HttpNotFound()); } var model = new LanguageEdit { LanguageId = (int)id, Name = language.Name, LanguageFamily = language.LanguageFamily }; return(View(model)); }
/// <summary> /// Creates a new StudyJobInfo object with the given "immutable" parameters. /// Product however can be set once externally (e.g. when the job is done). /// ExpectedPrecision defaults to 0, ie anything will do. /// </summary> public StudyJobInfo(TTarget target, LanguageEdit language, DateTime expirationDate, double expectedPrecision) { Id = Guid.NewGuid(); Target = target; ExpirationDate = expirationDate; Criteria = new StudyJobCriteria(language, expectedPrecision); }
public StudyJobInfo(TTarget target, LanguageEdit language, DateTime expirationDate, object criteria) { Id = Guid.NewGuid(); Target = target; ExpirationDate = expirationDate; Criteria = new StudyJobCriteria(language); }
public async Task CREATE_NEW() { var isSetup = false; await Setup(); try { isSetup = true; var isCreated = false; var languageEdit = await LanguageEdit.NewLanguageEditAsync(); isCreated = true; EnqueueConditional(() => isSetup); EnqueueConditional(() => isCreated); EnqueueCallback(() => Assert.IsNotNull(languageEdit)); EnqueueCallback(() => Assert.AreNotEqual(Guid.Empty, languageEdit.UserId)); EnqueueTestComplete(); } finally { Teardown(); } }
void AddLanguage() { if (string.IsNullOrEmpty(LanguageEdit)) { return; } int index = -1; // check if already exists if so update else add var t = JobDetails.JobLanguages.Where(x => x.Name.ToLower().Trim() == LanguageEdit.ToLower().Trim()).FirstOrDefault(); if (t != null) { index = JobLanguages.IndexOf(t); JobLanguages.Remove(t); } // new so just add JobDetailLanguage lnew = new JobDetailLanguage { Name = LanguageEdit, ProficiencyLevel = ((int)LanguageSliderValue).ToString() }; if (index > -1) { JobDetails.JobLanguages.Insert(index, lnew); } else { JobDetails.JobLanguages.Add(lnew); } ClearLanguageEdit(); }
public virtual async Task Setup() { //LOGIN await UserPrincipal.LoginAsync("user", "password"); //SET OUR LANGUAGES _ServerEnglishLang = await LanguageEdit.GetLanguageEditAsync("English"); _ServerSpanishLang = await LanguageEdit.GetLanguageEditAsync("Spanish"); if (_AllLanguages == null) { _AllLanguages = await LanguageList.GetAllAsync(); } _EnglishId = (from language in _AllLanguages where language.Text == SeedData.Ton.EnglishText select language.Id).First(); _SpanishId = (from language in _AllLanguages where language.Text == SeedData.Ton.SpanishText select language.Id).First(); await InitializeClientSeedDataSingleton(); }
public async Task GET_ALL_SET_NEW_LANGUAGE_CANCELEDIT() { var allPhrasesCount = -1; bool phrasesCountStaysTheSame = false; LanguageEdit initLang0 = null; LanguageEdit initLang1 = null; LanguageEdit initLang2 = null; PhraseList allPhrases = null; PhraseList canceledEditPhrases = null; var isAsyncComplete = false; var hasError = false; EnqueueConditional(() => isAsyncComplete); await Setup(); try { allPhrases = await PhraseList.GetAllAsync(); allPhrasesCount = allPhrases.Count; initLang0 = allPhrases[0].Language; initLang1 = allPhrases[1].Language; initLang2 = allPhrases[2].Language; allPhrases[0].BeginEdit(); allPhrases[0].Language = _ServerSpanishLang; allPhrases[0].CancelEdit(); canceledEditPhrases = allPhrases; phrasesCountStaysTheSame = allPhrasesCount == canceledEditPhrases.Count; } catch { hasError = true; } finally { EnqueueCallback( () => Assert.IsFalse(hasError), () => Assert.AreEqual(initLang0.Id, canceledEditPhrases[0].LanguageId), () => Assert.AreEqual(initLang1.Id, canceledEditPhrases[1].LanguageId), () => Assert.AreEqual(initLang2.Id, canceledEditPhrases[2].LanguageId), () => Assert.IsNotNull(allPhrases), () => Assert.IsNotNull(canceledEditPhrases), () => Assert.IsTrue(phrasesCountStaysTheSame), () => Assert.IsTrue(allPhrasesCount > 0), //KEEP THIS LAST IN THE CALLBACKS () => Teardown() ); EnqueueTestComplete(); isAsyncComplete = true; } }
// Update public bool UpdateLanguage(LanguageEdit model) { var entity = _context .Languages .Single(e => e.LanguageId == model.LanguageId && e.UserId == _userId); entity.Name = model.Name; entity.LanguageFamily = model.LanguageFamily; return(_context.SaveChanges() == 1); }
/// <summary> /// This method is called when the user presses the Go button. /// </summary> public async Task Go() { var ids = new MobileList <Guid>(); foreach (var songViewModel in Items) { if (songViewModel.IsChecked) { ids.Add(songViewModel.Model.Id); } } //var targetId = new Guid(@"5D4355FE-C46E-4AA1-9E4A-45288C341C44"); var targetId = Guid.NewGuid(); History.Events.ThinkingAboutTargetEvent.Publish(targetId); var songs = await MultiLineTextList.NewMultiLineTextListAsync(ids); History.Events.ThinkedAboutTargetEvent.Publish(targetId); var nativeLanguage = await LanguageEdit.GetLanguageEditAsync(GetNativeLanguageText()); var noExpirationDate = StudyJobInfo <MultiLineTextList, IViewModelBase> .NoExpirationDate; var precision = double.Parse(AppResources.DefaultExpectedPrecision); //CREATE JOB INFO var studyJobInfo = new StudyJobInfo <MultiLineTextList, IViewModelBase>(songs, nativeLanguage, noExpirationDate, precision); //CREATE OPPORTUNITY var opportunity = new Opportunity <MultiLineTextList, IViewModelBase>(Id, this, studyJobInfo, StudyResources.CategoryStudy); //ADD OPPORTUNITY TO OUR FUTURE OPPORTUNITIES FutureOpportunities.Add(opportunity); //LET THE HISTORY SHOW THAT YOU ARE THINKING ABOUT THIS OPPORTUNITY var opportunityId = opportunity.Id; History.Events.ThinkingAboutTargetEvent.Publish(opportunityId); //PUBLISH THE OPPORTUNITY Exchange.Ton.Publish(opportunity); //NOW, WE WAIT UNTIL WE HEAR A HANDLE(OFFER) MESSAGE. //TODO: TIMEOUT FOR OPPORTUNITY, BOTH EXPIRATION DATE AND WAITING FOR OFFER TIMEOUT }
public async Task GET() { #region Setup (try..) var isSetup = false; await Setup(); try { isSetup = true; EnqueueConditional(() => isSetup); #endregion Guid testId = _EnglishId; var isGotten = false; var isError = false; LanguageEdit languageEdit = null; try { languageEdit = await LanguageEdit.GetLanguageEditAsync(testId); isGotten = true; } catch (Exception) { isGotten = true; isError = true; } EnqueueConditional(() => isGotten); EnqueueConditional(() => isSetup); EnqueueCallback(() => Assert.IsNotNull(languageEdit)); EnqueueCallback(() => Assert.IsTrue(isGotten)); EnqueueCallback(() => Assert.IsFalse(isError)); EnqueueCallback(() => Assert.AreEqual(testId, languageEdit.Id)); EnqueueTestComplete(); #region (...finally) Teardown } finally { Teardown(); } #endregion }
private async Task InitializeModelAsync() { #region Thinking var thinkId = System.Guid.NewGuid(); History.Events.ThinkingAboutTargetEvent.Publish(thinkId); #endregion var newLanguage = await LanguageEdit.NewLanguageEditAsync(); #region Thinked History.Events.ThinkedAboutTargetEvent.Publish(thinkId); #endregion var languageViewModel = Services.Container.GetExportedValue <AddLanguageLanguageEditViewModel>(); languageViewModel.Model = newLanguage; LanguageViewModel = languageViewModel; }
void RemoveLanguage() { if (string.IsNullOrEmpty(LanguageEdit)) { return; } // check if already exists if so update else add var t = JobDetails.JobLanguages.Where(x => x.Name.ToLower().Trim() == LanguageEdit.ToLower().Trim()).FirstOrDefault(); if (t != null) { JobLanguages.Remove(t); } ClearLanguageEdit(); }
public async Task NEW_EDIT_BEGINSAVE_GET() { #region Setup (try..) var isAsyncComplete = false; var isSetup = false; await Setup(); try { isSetup = true; EnqueueConditional(() => isSetup); #endregion //NEW var languageEdit = await LanguageEdit.NewLanguageEditAsync(); //EDIT languageEdit.Text = "TestLanguage_NEW_EDIT_BEGINSAVE_GET"; //SAVE var savedLanguageEdit = await languageEdit.SaveAsync(); //GET (CONFIRM SAVE) var gottenLanguageEdit = await LanguageEdit.GetLanguageEditAsync(savedLanguageEdit.Id); isAsyncComplete = true; EnqueueConditional(() => isAsyncComplete); EnqueueCallback(() => Assert.IsNotNull(languageEdit)); EnqueueCallback(() => Assert.IsNotNull(savedLanguageEdit)); EnqueueCallback(() => Assert.IsNotNull(gottenLanguageEdit)); EnqueueCallback(() => Assert.AreNotEqual(languageEdit.Id, savedLanguageEdit.Id)); EnqueueCallback(() => Assert.AreEqual(savedLanguageEdit.Id, gottenLanguageEdit.Id)); EnqueueCallback(() => Assert.AreEqual(savedLanguageEdit.Text, gottenLanguageEdit.Text)); EnqueueTestComplete(); #region (...finally) Teardown } finally { Teardown(); } #endregion }
public ActionResult Edit(int id, LanguageEdit model) { if (!ModelState.IsValid) { return(View(model)); } if (model.LanguageId != id) { ModelState.AddModelError("", "Id Mismatch"); return(View(model)); } var service = CreateLanguageService(); if (service.UpdateLanguage(model)) { TempData["SaveResult"] = "Language was updated."; return(RedirectToAction("Index")); } ModelState.AddModelError("", "Language was not updated."); return(View(model)); }
public virtual async Task Setup() { //LOGIN await UserPrincipal.LoginAsync("user", "password"); //SET OUR LANGUAGES _ServerEnglishLang = await LanguageEdit.GetLanguageEditAsync("English"); _ServerSpanishLang = await LanguageEdit.GetLanguageEditAsync("Spanish"); if (_AllLanguages == null) _AllLanguages = await LanguageList.GetAllAsync(); _EnglishId = (from language in _AllLanguages where language.Text == SeedData.Ton.EnglishText select language.Id).First(); _SpanishId = (from language in _AllLanguages where language.Text == SeedData.Ton.SpanishText select language.Id).First(); await InitializeClientSeedDataSingleton(); }
public async Task NEW_EDIT_BEGINSAVE_GET_DELETE_GET() { #region Setup (try..) var isAsyncComplete = false; EnqueueConditional(() => isAsyncComplete); await Setup(); try { #endregion LanguageEdit languageEdit = null; LanguageEdit savedLanguageEdit = null; LanguageEdit gottenLanguageEdit = null; LanguageEdit deletedLanguageEdit = null; //INITIALIZE TO EMPTY LANGUAGE EDIT, BECAUSE WE EXPECT THIS TO BE NULL LATER LanguageEdit deleteConfirmedLanguageEdit = new LanguageEdit(); //NEW languageEdit = await LanguageEdit.NewLanguageEditAsync(); //EDIT languageEdit.Text = "TestLanguage"; //SAVE savedLanguageEdit = await languageEdit.SaveAsync(); //GET (CONFIRM SAVE) gottenLanguageEdit = await LanguageEdit.GetLanguageEditAsync(savedLanguageEdit.Id); //DELETE (MARKS DELETE. SAVE INITIATES ACTUAL DELETE IN DB) gottenLanguageEdit.Delete(); deletedLanguageEdit = await gottenLanguageEdit.SaveAsync(); EnqueueTestComplete(); try { deleteConfirmedLanguageEdit = await LanguageEdit.GetLanguageEditAsync(deletedLanguageEdit.Id); throw new Exception(); } catch (Csla.DataPortalException dpex) { //WE ARE EXPECTING ONLY ID NOT FOUND EXCEPTIONS if (!TestsHelper.IsIdNotFoundException(dpex)) throw dpex; Assert.IsNotNull(languageEdit); Assert.IsNotNull(savedLanguageEdit); Assert.IsNotNull(gottenLanguageEdit); Assert.IsNotNull(deletedLanguageEdit); Assert.AreEqual(Guid.Empty, deleteConfirmedLanguageEdit.Id); Assert.AreEqual(string.Empty, deleteConfirmedLanguageEdit.Text); Assert.AreEqual(Guid.Empty, deleteConfirmedLanguageEdit.UserId); Assert.AreEqual(string.Empty, deleteConfirmedLanguageEdit.Username); } #region (...finally) Teardown } finally { Teardown(); isAsyncComplete = true; } #endregion }
public async Task NEW_EDIT_BEGINSAVE_GET_DELETE_GET() { #region Setup (try..) var isAsyncComplete = false; EnqueueConditional(() => isAsyncComplete); await Setup(); try { #endregion LanguageEdit languageEdit = null; LanguageEdit savedLanguageEdit = null; LanguageEdit gottenLanguageEdit = null; LanguageEdit deletedLanguageEdit = null; //INITIALIZE TO EMPTY LANGUAGE EDIT, BECAUSE WE EXPECT THIS TO BE NULL LATER LanguageEdit deleteConfirmedLanguageEdit = new LanguageEdit(); //NEW languageEdit = await LanguageEdit.NewLanguageEditAsync(); //EDIT languageEdit.Text = "TestLanguage"; //SAVE savedLanguageEdit = await languageEdit.SaveAsync(); //GET (CONFIRM SAVE) gottenLanguageEdit = await LanguageEdit.GetLanguageEditAsync(savedLanguageEdit.Id); //DELETE (MARKS DELETE. SAVE INITIATES ACTUAL DELETE IN DB) gottenLanguageEdit.Delete(); deletedLanguageEdit = await gottenLanguageEdit.SaveAsync(); EnqueueTestComplete(); try { deleteConfirmedLanguageEdit = await LanguageEdit.GetLanguageEditAsync(deletedLanguageEdit.Id); throw new Exception(); } catch (Csla.DataPortalException dpex) { //WE ARE EXPECTING ONLY ID NOT FOUND EXCEPTIONS if (!TestsHelper.IsIdNotFoundException(dpex)) { throw dpex; } Assert.IsNotNull(languageEdit); Assert.IsNotNull(savedLanguageEdit); Assert.IsNotNull(gottenLanguageEdit); Assert.IsNotNull(deletedLanguageEdit); Assert.AreEqual(Guid.Empty, deleteConfirmedLanguageEdit.Id); Assert.AreEqual(string.Empty, deleteConfirmedLanguageEdit.Text); Assert.AreEqual(Guid.Empty, deleteConfirmedLanguageEdit.UserId); Assert.AreEqual(string.Empty, deleteConfirmedLanguageEdit.Username); } #region (...finally) Teardown } finally { Teardown(); isAsyncComplete = true; } #endregion }
/// <summary> /// This method is called when the user presses the Go button. /// </summary> public async Task Go() { if (!CanGo) { return; } DisableNavigationRequestedEventMessage.Publish(); GoInProgress = true; try { var ids = new MobileList <Guid>(); foreach (var songViewModel in Items) { if (songViewModel.IsChecked) { Guid id = default(Guid); var results = from entry in _MultiLineTextIdsAndTitles where entry.Value == songViewModel.SongTitle select entry; id = results.First().Key; ids.Add(id); } } MultiLineTextList songs = null; #region Try ...(thinking) //var targetId = new Guid(@"5D4355FE-C46E-4AA1-9E4A-45288C341C44"); var targetId = Guid.NewGuid(); History.Events.ThinkingAboutTargetEvent.Publish(targetId); try { #endregion songs = await MultiLineTextList.NewMultiLineTextListAsync(ids); #region ...Finally (thinked) } finally { History.Events.ThinkedAboutTargetEvent.Publish(targetId); } #endregion var nativeLanguage = await LanguageEdit.GetLanguageEditAsync(GetNativeLanguageText()); var noExpirationDate = StudyJobInfo <MultiLineTextList, IViewModelBase> .NoExpirationDate; var precision = double.Parse(StudyResources.DefaultExpectedPrecision); //CREATE JOB INFO var studyJobInfo = new StudyJobInfo <MultiLineTextList, IViewModelBase>(songs, nativeLanguage, noExpirationDate, precision); //CREATE OPPORTUNITY var opportunity = new Opportunity <MultiLineTextList, IViewModelBase>(Id, this, studyJobInfo, StudyResources.CategoryStudy); //ADD OPPORTUNITY TO OUR FUTURE OPPORTUNITIES FutureOpportunities.Add(opportunity); //LET THE HISTORY SHOW THAT YOU ARE THINKING ABOUT THIS OPPORTUNITY var opportunityId = opportunity.Id; History.Events.ThinkingAboutTargetEvent.Publish(System.Guid.Empty); //PUBLISH THE OPPORTUNITY Exchange.Ton.Publish(opportunity); //NOW, WE WAIT UNTIL WE HEAR A HANDLE(OFFER) MESSAGE. //TODO: TIMEOUT FOR OPPORTUNITY, BOTH EXPIRATION DATE AND WAITING FOR OFFER TIMEOUT } finally { EnableNavigationRequestedEventMessage.Publish(); } }
public void InitializePhraseTests() { //WE NEED TO UPDATE THE CLIENT SeedData.Ton IDS. var isLoaded = false; var phrasesCorrected = false; Exception error = new Exception(); Exception errorPhraseList = new Exception(); LanguageList allLanguages = null; PhraseList allPhrases = null; LanguageList.GetAll((s, r) => { #region Initialize Language Data error = r.Error; if (error != null) throw error; allLanguages = r.Object; _ServerEnglishLang = (from language in allLanguages where language.Text == SeedData.Ton.EnglishText select language).First(); SeedData.Ton.EnglishLanguageDto.Id = _ServerEnglishLang.Id; _ServerSpanishLang = (from language in allLanguages where language.Text == SeedData.Ton.SpanishText select language).First(); SeedData.Ton.SpanishLanguageDto.Id = _ServerSpanishLang.Id; #endregion isLoaded = true; PhraseList.GetAll((s2, r2) => { errorPhraseList = r2.Error; if (errorPhraseList != null) throw errorPhraseList; allPhrases = r2.Object; var serverHelloPhraseQuery = (from phrase in allPhrases where phrase.Text == SeedData.Ton.HelloText && phrase.Language.Text == SeedData.Ton.EnglishText select phrase); PhraseEdit serverHelloPhrase = null; if (serverHelloPhraseQuery.Count() == 0) //we don't have the hello phrase in the db, so put it there { var phrase = allPhrases[0]; phrase.BeginEdit(); phrase.Text = SeedData.Ton.HelloText; phrase.Language = _ServerEnglishLang; phrase.ApplyEdit(); serverHelloPhrase = phrase; } else serverHelloPhrase = serverHelloPhraseQuery.First(); var serverHolaPhraseQuery = (from phrase in allPhrases where phrase.Text == SeedData.Ton.HolaText && phrase.Language.Text == SeedData.Ton.EnglishText select phrase); PhraseEdit serverHolaPhrase = null; if (serverHolaPhraseQuery.Count() == 0) //we don't have the Hola phrase in the db, so put it there { var phrase = allPhrases[1]; phrase.BeginEdit(); phrase.Text = SeedData.Ton.HolaText; phrase.Language = _ServerSpanishLang; phrase.ApplyEdit(); serverHolaPhrase = phrase; } else serverHolaPhrase = serverHolaPhraseQuery.First(); var serverLongPhraseQuery = (from phrase in allPhrases where phrase.Text == SeedData.Ton.LongText && phrase.Language.Text == SeedData.Ton.EnglishText select phrase); PhraseEdit serverLongPhrase = null; if (serverLongPhraseQuery.Count() == 0) //we don't have the Long phrase in the db, so put it there { var phrase = allPhrases[2]; phrase.BeginEdit(); phrase.Text = SeedData.Ton.LongText; phrase.Language = _ServerEnglishLang; phrase.ApplyEdit(); serverLongPhrase = phrase; } else serverLongPhrase = serverLongPhraseQuery.First(); var serverDogPhraseQuery = (from phrase in allPhrases where phrase.Text == SeedData.Ton.DogText && phrase.Language.Text == SeedData.Ton.EnglishText select phrase); PhraseEdit serverDogPhrase = null; if (serverDogPhraseQuery.Count() == 0) //we don't have the Dog phrase in the db, so put it there { var phrase = allPhrases[3]; phrase.BeginEdit(); phrase.Text = SeedData.Ton.DogText; phrase.Language = _ServerSpanishLang; phrase.ApplyEdit(); serverDogPhrase = phrase; } else serverDogPhrase = serverDogPhraseQuery.First(); var validUserId = serverHelloPhrase.UserId; SeedData.Ton.GetTestValidUserDto().Id = validUserId; SeedData.Ton.HelloPhraseDto.Id = serverHelloPhrase.Id; SeedData.Ton.HolaPhraseDto.Id = serverHolaPhrase.Id; SeedData.Ton.LongPhraseDto.Id = serverLongPhrase.Id; SeedData.Ton.DogPhraseDto.Id = serverDogPhrase.Id; SeedData.Ton.HelloPhraseDto.UserId = serverHelloPhrase.UserId; SeedData.Ton.HolaPhraseDto.UserId = serverHolaPhrase.UserId; SeedData.Ton.LongPhraseDto.UserId = serverLongPhrase.UserId; SeedData.Ton.DogPhraseDto.UserId = serverDogPhrase.UserId; phrasesCorrected = true; }); }); EnqueueConditional(() => isLoaded); EnqueueConditional(() => phrasesCorrected); EnqueueCallback(() => { Assert.IsNull(error); }, () => { Assert.IsNotNull(allLanguages); }, () => { Assert.AreNotEqual(Guid.Empty, SeedData.Ton.EnglishId); }, () => { Assert.AreNotEqual(Guid.Empty, SeedData.Ton.SpanishId); }, () => { Assert.IsTrue(allLanguages.Count > 0); }); EnqueueTestComplete(); }
public void NEW_EDIT_BEGINSAVE_GET_DELETE_GET() { //INITIALIZE ERRORS TO EXCEPTION, BECAUSE EXPECT THEM TO BE NULL LATER Exception newError = new Exception(); Exception savedError = new Exception(); Exception gottenError = new Exception(); Exception deletedError = new Exception(); //INITIALIZE CONFIRM TO NULL, BECAUSE WE EXPECT THIS TO BE AN ERROR LATER Exception deleteConfirmedError = null; LanguageEdit languageEdit = null; LanguageEdit savedLanguageEdit = null; LanguageEdit gottenLanguageEdit = null; LanguageEdit deletedLanguageEdit = null; //INITIALIZE TO EMPTY LANGUAGE EDIT, BECAUSE WE EXPECT THIS TO BE NULL LATER LanguageEdit deleteConfirmedLanguageEdit = new LanguageEdit(); var isNewed = false; var isSaved = false; var isGotten = false; var isDeleted = false; var isDeleteConfirmed = false; //NEW LanguageEdit.NewLanguageEdit((s, r) => { newError = r.Error; if (newError != null) throw newError; languageEdit = r.Object; isNewed = true; //EDIT languageEdit.Text = "TestLanguage"; //SAVE languageEdit.BeginSave((s2, r2) => { savedError = r2.Error; if (savedError != null) throw savedError; savedLanguageEdit = r2.NewObject as LanguageEdit; isSaved = true; //GET (CONFIRM SAVE) LanguageEdit.GetLanguageEdit(savedLanguageEdit.Id, (s3, r3) => { gottenError = r3.Error; if (gottenError != null) throw gottenError; gottenLanguageEdit = r3.Object; isGotten = true; //DELETE (MARKS DELETE. SAVE INITIATES ACTUAL DELETE IN DB) gottenLanguageEdit.Delete(); gottenLanguageEdit.BeginSave((s4, r4) => { deletedError = r4.Error; if (deletedError != null) throw deletedError; deletedLanguageEdit = r4.NewObject as LanguageEdit; //TODO: Figure out why LanguageEditTests final callback gets thrown twice. The server throws expected exception, but callback is executed twice. LanguageEdit.GetLanguageEdit(deletedLanguageEdit.Id, (s5, r5) => { deleteConfirmedError = r5.Error; if (deleteConfirmedError != null) { isDeleteConfirmed = true; throw new ExpectedException(deleteConfirmedError); } deleteConfirmedLanguageEdit = r5.Object; }); }); }); }); }); EnqueueConditional(() => isNewed); EnqueueConditional(() => isSaved); EnqueueConditional(() => isGotten); EnqueueConditional(() => isDeleted); EnqueueConditional(() => isDeleteConfirmed); EnqueueCallback( () => { Assert.IsNull(newError); }, () => { Assert.IsNull(savedError); }, () => { Assert.IsNull(gottenError); }, () => { Assert.IsNull(deletedError); }, //WE EXPECT AN ERROR, AS WE TRIED A GET ON AN ID THAT SHOULD HAVE BEEN DELETED () => { Assert.IsNotNull(deleteConfirmedError); }, () => { Assert.IsNotNull(languageEdit); }, () => { Assert.IsNotNull(savedLanguageEdit); }, () => { Assert.IsNotNull(gottenLanguageEdit); }, () => { Assert.IsNotNull(deletedLanguageEdit); }, () => { Assert.IsNull(deleteConfirmedLanguageEdit); }); EnqueueTestComplete(); }
public StudyJobCriteria(LanguageEdit language) { Language = language; }
public StudyJobCriteria(LanguageEdit language, double expectedPrecision) { Language = language; ExpectedPrecision = expectedPrecision; }
public StudyJobCriteria(LanguageEdit language, double expectedPrecision) { Language = language; ExpectedPrecision = expectedPrecision; }
public void InitializeLineTests() { var isLoaded = false; LanguageEdit.GetLanguageEdit("English", (s, r) => { if (r.Error != null) throw r.Error; _ServerEnglishLang = r.Object; isLoaded = true; }); EnqueueConditional(() => isLoaded); EnqueueCallback(() => { Assert.IsNotNull(_ServerEnglishLang); }); EnqueueTestComplete(); }
public StudyJobCriteria(LanguageEdit language) { Language = language; }