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);
            }
        }