Пример #1
0
        /// <summary>
        /// Danner en kalenderaftale for en bruger.
        /// </summary>
        /// <param name="system">System under OSWEBDB, som brugerens aftale er tilknyttet.</param>
        /// <param name="aftale">Aftale.</param>
        /// <param name="bruger">Bruger.</param>
        /// <param name="properties">Værdi for aftalens properties.</param>
        public Brugeraftale(ISystem system, IAftale aftale, IBruger bruger, int properties = 0)
            : base(properties)
        {
            ArgumentNullGuard.NotNull(system, nameof(system))
            .NotNull(aftale, nameof(aftale))
            .NotNull(bruger, nameof(bruger));

            _system = system;
            _aftale = aftale;
            _bruger = bruger;
        }
Пример #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());
        }