public void TestAtGetByIdKasterIntranetRepositoryExceptionHvisAftaleIkkeFindes()
        {
            var fixture = new Fixture();

            fixture.Inject(MockRepository.GenerateMock <ISystem>());
            fixture.Inject(DateTime.Now);
            var aftaler = new List <IAftale>
            {
                new Aftale(fixture.Create <ISystem>(), fixture.Create <int>(),
                           fixture.Create <DateTime>(),
                           fixture.Create <DateTime>().AddMinutes(15),
                           fixture.Create <string>()),
                new Aftale(fixture.Create <ISystem>(), fixture.Create <int>(),
                           fixture.Create <DateTime>(),
                           fixture.Create <DateTime>().AddMinutes(15),
                           fixture.Create <string>()),
                new Aftale(fixture.Create <ISystem>(), fixture.Create <int>(),
                           fixture.Create <DateTime>(),
                           fixture.Create <DateTime>().AddMinutes(15),
                           fixture.Create <string>())
            };
            var aftalelisteHelper = new AftalelisteHelper(aftaler);

            Assert.That(aftalelisteHelper, Is.Not.Null);

            Assert.Throws <IntranetRepositoryException>(() => aftalelisteHelper.GetById(-1));
        }
        public void TestAtGetByIdHenterAftale()
        {
            var fixture = new Fixture();

            fixture.Inject(MockRepository.GenerateMock <ISystem>());
            fixture.Inject(DateTime.Now);
            var aftaler = new List <IAftale>
            {
                new Aftale(fixture.Create <ISystem>(), fixture.Create <int>(),
                           fixture.Create <DateTime>(),
                           fixture.Create <DateTime>().AddMinutes(15),
                           fixture.Create <string>()),
                new Aftale(fixture.Create <ISystem>(), fixture.Create <int>(),
                           fixture.Create <DateTime>(),
                           fixture.Create <DateTime>().AddMinutes(15),
                           fixture.Create <string>()),
                new Aftale(fixture.Create <ISystem>(), fixture.Create <int>(),
                           fixture.Create <DateTime>(),
                           fixture.Create <DateTime>().AddMinutes(15),
                           fixture.Create <string>())
            };
            var aftalelisteHelper = new AftalelisteHelper(aftaler);

            Assert.That(aftalelisteHelper, Is.Not.Null);

            var aftale = aftalelisteHelper.GetById(aftaler.ElementAt(1).Id);

            Assert.That(aftale, Is.Not.Null);
            Assert.That(aftale.Id, Is.EqualTo(aftaler.ElementAt(1).Id));
            Assert.That(aftale.Emne, Is.Not.Null);
            Assert.That(aftale.Emne, Is.EqualTo(aftaler.ElementAt(1).Emne));
        }