public void UpdateAnimalStoryDetailsWrongStory() { var ansd = new AnimalStoryDetail { animalStoryId = 1, language = (int)Languages.he, name = "שם" }; context.UpdateAnimalStoryDetail(ansd); }
public void UpdateAnimalStoryDetailsWrongLangauge() { var ansd = new AnimalStoryDetail { animalStoryId = 1, language = -100, name = "גילי הבבון", story = "לגילי הבבון סיפור מיוחד ומרגש" }; context.UpdateAnimalStoryDetail(ansd); }
public void UpdateAnimalStoryDetailsNameExists() { var ansd = new AnimalStoryDetail { animalStoryId = 1, language = (int)Languages.en, name = "Shosh the Zebra", story = "Gili the baboon have a very speacial story" }; context.UpdateAnimalStoryDetail(ansd); }
public void UpdateAnimalStoryDetailsAddAnimalNameExists() { var ansd = new AnimalStoryDetail { animalStoryId = default(int), name = "גילי בבון הזית", story = "סיפור", language = (int)Languages.he }; context.UpdateAnimalStoryDetail(ansd); }
public void UpdateAnimalStoryDetailsAddAnimalStoryDoesntExists() { var ansd = new AnimalStoryDetail { animalStoryId = -1, name = "שם", story = "סיפור", language = (int)Languages.ar }; context.UpdateAnimalStoryDetail(ansd); }
public void UpdateAnimalStoryDetailsWrongName() { var ansd = new AnimalStoryDetail { animalStoryId = 1, language = (int)Languages.he, name = " ", story = "לגילי הבבון סיפור מיוחד ומרגש" }; context.UpdateAnimalStoryDetail(ansd); }
public void UpdateAnimalStoryDetailsAddStoryValidTest() { var details = context.GetAllAnimalStoryDetailsById(2); Assert.AreEqual(1, details.Count()); var det = new AnimalStoryDetail { animalStoryId = 2, name = "שוש הזברה", story = "לשוש הזברה ספור מיוחד מאוד.", language = (int)Languages.he }; context.UpdateAnimalStoryDetail(det); details = context.GetAllAnimalStoryDetailsById(2); Assert.AreEqual(2, details.Count()); }
public void UpdateAnimalStoryDetail(AnimalStoryDetail animalStoryDetail) { try { using (var db = GetContext()) { if (!ValidateSessionId(db)) { throw new AuthenticationException("Couldn't validate the session"); } db.UpdateAnimalStoryDetail(animalStoryDetail); } } catch (Exception Exp) { var animalStoryDetailInput = "Animal Stroy Id: " + animalStoryDetail.animalStoryId + ", name: " + animalStoryDetail.name + ", story: " + animalStoryDetail.story + ", language: " + animalStoryDetail.language; Logger.GetInstance(isTesting).WriteLine(Exp.Message, Exp.StackTrace, animalStoryDetailInput); throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
public void UpdateAnimalStoryDetailsValidInput() { var details = context.GetAllAnimalStoryDetailsById(1); Assert.AreEqual(2, details.Count()); var ansd = new AnimalStoryDetail { animalStoryId = 1, language = (int)Languages.he, name = "גילי הבבון", story = "לגילי הבבון סיפור מיוחד ומרגש" }; ansd.name = "אביב מאג"; context.UpdateAnimalStoryDetail(ansd); details = context.GetAllAnimalStoryDetailsById(1); Assert.AreEqual(2, details.Count()); Assert.IsTrue(details.Any(d => d.name == "אביב מאג")); Assert.IsFalse(details.Any(d => d.name == "גילי הבבון")); }