Exemplo n.º 1
0
        public async Task AtLegeHarAktivSuspansjonITillegg()
        {
            const int hprnummer = 123456789;
            var       person    = new TestLege(hprnummer).SuspenderTillegg();

            channel.HentPersonAsync(Arg.Any <int>(), null).Returns(person);

            var repositorySut = new HprService(factory, logger);
            var result        = await repositorySut.SjekkGodkjenning(hprnummer.ToString());

            Assert.That(result, Is.False);
        }
Exemplo n.º 2
0
        public async Task AtLegeErSuspendert()
        {
            const int hprnummer = 123456789;
            var       person    = new TestLege(hprnummer).Suspender();

            channel.HentPersonAsync(Arg.Any <int>(), null).Returns(person);

            var repositorySut = new HprService(factory, logger);

            repositorySut.LeggTilGodkjenteHelsepersonellkategori(Kodekonstanter.OId9060Lege);
            var result = await repositorySut.SjekkGodkjenning(hprnummer.ToString());

            Assert.That(result, Is.False);
        }
Exemplo n.º 3
0
        public async Task AtViKanLasteEnPerson()
        {
            const int hprnummer = 123456789;
            var       person    = new TestLege(hprnummer);

            channel.HentPersonAsync(Arg.Any <int>(), null).Returns(person);

            var repositorySut = new HprService(factory, logger);

            repositorySut.LeggTilGodkjenteHelsepersonellkategori(Kodekonstanter.OId9060Lege);
            var result = await repositorySut.HentPerson(hprnummer.ToString());

            Assert.That(result, Is.Not.Null);
            Assert.Multiple(() =>
            {
                Assert.That(result.HPRNummer, Is.EqualTo(hprnummer));
                Assert.That(result.FysiskeAdresser.Length, Is.EqualTo(1));
                Assert.That(result.FysiskeAdresser[0].Gateadresse, Is.EqualTo(person.FysiskeAdresser[0].Gateadresse));
            });
        }