public void GivenANewCaseFileItIsStored() { var mockedStorable = new Mock <Storable>(); var controller = new CaseFileController(mockedStorable.Object); var casefile = new CaseFile(); controller.Add(casefile); mockedStorable.Verify(s => s.Save(casefile)); }
public void GivenAnExistingCaseFileWhenItIsLookedForThenItIsFound() { var mockedStorable = new Mock <Storable>(); var controller = new CaseFileController(mockedStorable.Object); var casefile = new CaseFile { DocketId = 1 }; mockedStorable.Setup(s => s.FindByDocketId(1)).Returns(casefile); var result = controller.RetrieveByDocketId(1); Assert.AreEqual(1, result.Value.Count); Assert.AreSame(casefile, result.Value[0]); }
public void GivenTheDatabaseIsInBadStateWhenTheDatabaseThrowsAnErrorThenTheErrorIsBubbledToTheTopOfTheApplication() { var mockedStorable = new Mock <Storable>(); var controller = new CaseFileController(mockedStorable.Object); mockedStorable.Setup(s => s.FindByDocketId(1)).Throws <ConstraintException>(); try { controller.RetrieveByDocketId(1); Assert.Fail(); } catch (Exception e) { Assert.IsInstanceOf <ConstraintException>(e); } }
public void ShowCaseFile() { caseFileAnimator.SetTrigger("opens"); StartCoroutine(ShowTextDelay()); CaseFileController case_file_controller = GetComponent <CaseFileController>(); case_file_controller.UpdateText(); openedCaseFile.SetActive(true); camera_controller.canMove = false; sound_effect_controller.PlayPaperSound(); moveButtons.SetActive(false); if (camera_controller.game_status == gameState.incoming_mission) { camera_controller.game_status = gameState.mission_preparation; sound_effect_controller.PlayMissionBriefingSound(); } }