示例#1
0
        public void T310_Read_Empty(Part.LaesInputType inp)
        {
            var person = TestRunner.PartService.Read(inp);

            Assert.IsNotNull(person);
            ValidateInvalid(person.StandardRetur);
            Assert.IsNull(person.LaesResultat);
        }
示例#2
0
        public void T330_Read_NonexistingUuid(string uuid)
        {
            Part.LaesInputType input = new Part.LaesInputType()
            {
                UUID = uuid,
            };
            var person = TestRunner.PartService.Read(input);

            Assert.IsNotNull(person);
            ValidateInvalid(person.StandardRetur);
            Assert.IsNull(person.LaesResultat);
        }
示例#3
0
        public void T510_Search_Name(string cprNumber)
        {
            var personUuid = TestRunner.PartService.GetUuid(cprNumber);

            Validate(personUuid);

            Part.LaesInputType input = new Part.LaesInputType()
            {
                UUID = personUuid.UUID,
            };
            var personObject = TestRunner.PartService.Read(input);

            Validate(new Guid(personUuid.UUID), personObject, TestRunner.PartService);

            var personRegistration = personObject.LaesResultat.Item as Part.RegistreringType1;


            var searchCriteria = new Part.SoegInputType1()
            {
                SoegObjekt = new Part.SoegObjektType()
                {
                    SoegAttributListe = new Part.SoegAttributListeType()
                    {
                        SoegEgenskab = new Part.SoegEgenskabType[]
                        {
                            new Part.SoegEgenskabType()
                            {
                                NavnStruktur = new Part.NavnStrukturType()
                                {
                                    PersonNameStructure = new Part.PersonNameStructureType()
                                    {
                                        PersonGivenName   = personRegistration.AttributListe.Egenskab[0].NavnStruktur.PersonNameStructure.PersonGivenName,
                                        PersonMiddleName  = personRegistration.AttributListe.Egenskab[0].NavnStruktur.PersonNameStructure.PersonMiddleName,
                                        PersonSurnameName = personRegistration.AttributListe.Egenskab[0].NavnStruktur.PersonNameStructure.PersonSurnameName,
                                    }
                                }
                            }
                        }
                    }
                }
            };

            var result = TestRunner.PartService.Search(searchCriteria);

            Assert.NotNull(result, "Search result");
            Validate(result.StandardRetur);
            Assert.IsNotNull(result.Idliste, "Search result ids");

            Assert.AreEqual(1, result.Idliste.Length, "Number of search results");
            Assert.AreNotEqual(Guid.Empty, result.Idliste[0], "Empty laesResultat uuid from search");
            Assert.AreEqual(personUuid.UUID, result.Idliste[0], "Search result returns wrong uuids");
        }
示例#4
0
        public void T300_Read(string cprNumber)
        {
            var uuid = TestRunner.PartService.GetUuid(cprNumber);

            Validate(uuid);

            Part.LaesInputType input = new Part.LaesInputType()
            {
                UUID = uuid.UUID,
            };
            LaesOutputType person = TestRunner.PartService.Read(input);

            Validate(new Guid(uuid.UUID), person, TestRunner.PartService);
        }
示例#5
0
        public void T350_RefreshRead(string cprNumber)
        {
            var uuid = TestRunner.PartService.GetUuid(cprNumber);

            Validate(uuid);

            Part.LaesInputType input = new Part.LaesInputType()
            {
                UUID = uuid.UUID,
            };
            var freshPerson = TestRunner.PartService.RefreshRead(input);

            Validate(new Guid(uuid.UUID), freshPerson, TestRunner.PartService);

            //Assert.AreNotEqual(TestRunner.PartService.QualityHeaderValue.QualityLevel.Value, Part.QualityLevel.LocalCache);
        }
示例#6
0
        public void T320_Read_InvalidUuid(string uuid)
        {
            Part.LaesInputType input = new Part.LaesInputType()
            {
                UUID = uuid,
            };
            TestRunner.PartService.SourceUsageOrderHeaderValue = new SourceUsageOrderHeader()
            {
                SourceUsageOrder = SourceUsageOrder.LocalThenExternal
            };
            var person = TestRunner.PartService.Read(input);

            Assert.IsNotNull(person);
            ValidateInvalid(person.StandardRetur);
            Assert.IsNull(person.LaesResultat);
        }
示例#7
0
        // TODO: Add more methods to test Search for criteria other than CPR number


        //[Test]
        //[TestCaseSource(typeof(TestData), TestData.CprNumbersFieldName)]
        public void T600_Database_Update(string cprNumber)
        {
            var uuid = TestRunner.PartService.GetUuid(cprNumber);

            Part.LaesInputType input = new Part.LaesInputType()
            {
                UUID = uuid.UUID.ToString(),
            };
            var fresh = TestRunner.PartService.RefreshRead(input);

            Validate(new Guid(uuid.UUID), fresh, TestRunner.PartService);
            //Assert.AreNotEqual(Part.QualityLevel.LocalCache, TestRunner.PartService.QualityHeaderValue.QualityLevel.Value);

            var cached = TestRunner.PartService.Read(input);

            Validate(new Guid(uuid.UUID), cached, TestRunner.PartService);
            //Assert.AreEqual(Part.QualityLevel.LocalCache, TestRunner.PartService.QualityHeaderValue.QualityLevel.Value);

            // Now validate contents
            Assert.True(Utilities.AreEqual <Part.RegistreringType1>(fresh.LaesResultat.Item as Part.RegistreringType1, cached.LaesResultat.Item as Part.RegistreringType1), "Equal response from data provider and local cache");
        }