예제 #1
0
        // GET: Lore
        public virtual ActionResult List()
        {
            var cmd   = new GetTomes();
            var tomes = DomainRegistry.Repository.Find(cmd);

            SetMessages();
            return(View(MVC.Admin.Views.Tomes.List, tomes));
        }
예제 #2
0
        public void Should_fetch_all_available_tomes()
        {
            new TomeBuilder().With(cr => cr.Id, 7)
            .With(cr => cr.Text, "First Tome")
            .With(cr => cr.BaseItem, new ItemSourceBuilder().With(cr => cr.Id, 195).BuildAndSave())
            .BuildAndSave();

            new TomeBuilder().With(cr => cr.Id, 13)
            .With(cr => cr.Text, "Second Tome")
            .With(cr => cr.BaseItem, new ItemSourceBuilder().With(cr => cr.Id, 196).BuildAndSave())
            .BuildAndSave();

            var cmd = new GetTomes();

            Assert.That(DomainRegistry.Repository.Find(cmd), Has.Exactly(2).Items);
        }
예제 #3
0
        public void Should_return_empty_list_if_no_tomes_found()
        {
            var cmd = new GetTomes();

            Assert.That(DomainRegistry.Repository.Find(cmd), Is.Empty);
        }