Exemple #1
0
        public void TestAtAftaleGetBySystemAndIdHenterAftale()
        {
            var aftale = _kalenderRepository.AftaleGetBySystemAndId(1, 1);

            Assert.That(aftale, Is.Not.Null);
            Assert.That(aftale.System, Is.Not.Null);
            Assert.That(aftale.Deltagere, Is.Not.Null);
            foreach (var deltager in aftale.Deltagere)
            {
                Assert.That(deltager, Is.Not.Null);
                Assert.That(deltager.System, Is.Not.Null);
                Assert.That(deltager.Aftale, Is.Not.Null);
                Assert.That(deltager.Bruger, Is.Not.Null);
            }
        }
Exemple #2
0
        public void TestAtAftaleGetBySystemAndIdHenterAftale()
        {
            AftaleProxy appointmentProxy = _fixture.Build <AftaleProxy>()
                                           .With(m => m.FraTidspunkt, DateTime.MinValue)
                                           .With(m => m.TilTidspunkt, DateTime.MaxValue)
                                           .Create();

            IKalenderRepository sut = CreateSut(appointmentProxy: appointmentProxy);

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

            int     systemNo = _fixture.Create <int>();
            int     calId    = _fixture.Create <int>();
            IAftale result   = sut.AftaleGetBySystemAndId(systemNo, calId);

            Assert.That(result, Is.Not.Null);
            Assert.That(result, Is.EqualTo(appointmentProxy));

            _dataProviderMock.AssertWasCalled(m => m.Get(Arg <AftaleProxy> .Matches(n => n.System != null && n.System.Nummer == systemNo && n.Id == calId)), opt => opt.Repeat.Once());
        }
Exemple #3
0
        public void TestAtAftaleGetBySystemAndIdKasterIntranetRepositoryExceptionVedException()
        {
            Exception exception = _fixture.Create <Exception>();

            IKalenderRepository sut = CreateSut(exception: exception);

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

            IntranetRepositoryException result = Assert.Throws <IntranetRepositoryException>(() => sut.AftaleGetBySystemAndId(_fixture.Create <int>(), _fixture.Create <int>()));

            TestHelper.AssertIntranetRepositoryExceptionIsValid(result, exception, ExceptionMessage.RepositoryError, "AftaleGetBySystemAndId", exception.Message);
        }
Exemple #4
0
        public void TestAtAftaleGetBySystemAndIdKasterIntranetRepositoryExceptionVedIntranetRepositoryException()
        {
            IntranetRepositoryException intranetRepositoryException = _fixture.Create <IntranetRepositoryException>();

            IKalenderRepository sut = CreateSut(exception: intranetRepositoryException);

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

            IntranetRepositoryException result = Assert.Throws <IntranetRepositoryException>(() => sut.AftaleGetBySystemAndId(_fixture.Create <int>(), _fixture.Create <int>()));

            Assert.That(result, Is.Not.Null);
            Assert.That(result, Is.EqualTo(intranetRepositoryException));
        }