public void T410_List_All(string[] cprNumbers) { Part.ListInputType input = new Part.ListInputType() { UUID = cprNumbers == null ? null : Array.ConvertAll <string, string>(cprNumbers, (cpr) => GetUuid(cpr).UUID), }; var persons = TestRunner.PartService.List(input); Assert.IsNotNull(persons); if (cprNumbers != null) { Validate(persons.StandardRetur); Assert.IsNotNull(persons, "List response is null"); Assert.IsNotNull(persons.LaesResultat, "Persons array is null"); Assert.AreEqual(cprNumbers.Length, persons.LaesResultat.Length, "Incorrect length of returned array"); for (int i = 0; i < cprNumbers.Length; i++) { Validate(new Guid(input.UUID[i]), persons.LaesResultat[i], TestRunner.PartService); } } else { ValidateInvalid(persons.StandardRetur); Assert.IsNull(persons.LaesResultat); } }
public void T400_List_Single(string cprNumber) { string[] cprNumbers = new string[] { cprNumber }; Part.ListInputType input = new Part.ListInputType() { UUID = Array.ConvertAll <string, string>(cprNumbers, (cpr) => TestRunner.PartService.GetUuid(cpr).UUID), }; var persons = TestRunner.PartService.List(input); Assert.IsNotNull(persons, "List response is null"); Validate(persons.StandardRetur); Assert.IsNotNull(persons.LaesResultat, "Persons array is null"); Assert.AreEqual(cprNumbers.Length, persons.LaesResultat.Length, "Incorrect length of returned array"); for (int i = 0; i < cprNumbers.Length; i++) { Validate(new Guid(input.UUID[i]), persons.LaesResultat[i], TestRunner.PartService); } }
public void T405_List_SingleWithPartial(string cprNumber) { string[] cprNumbers = new string[] { cprNumber }; var uuids = new List <string>(Array.ConvertAll <string, string>(cprNumbers, (cpr) => TestRunner.PartService.GetUuid(cpr).UUID)); uuids.Add(Guid.NewGuid().ToString()); Part.ListInputType input = new Part.ListInputType() { UUID = uuids.ToArray(), }; var persons = TestRunner.PartService.List(input); Assert.IsNotNull(persons, "List response is null"); Assert.AreEqual("206", persons.StandardRetur.StatusKode); Assert.IsNotNull(persons.LaesResultat, "Persons array is null"); for (int i = 0; i < cprNumbers.Length; i++) { Validate(new Guid(input.UUID[i]), persons.LaesResultat[i], TestRunner.PartService); } Assert.IsNull(persons.LaesResultat[1].Item); }
public void T410_List_Mixed( [Values(1, 10, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000)] int count) { var uuids = new List <string>(); for (int i = 0; i < count; i++) { uuids.Add(Guid.NewGuid().ToString()); } uuids.AddRange(Array.ConvertAll <string, string>(TestData.cprNumbers, (cpr) => GetUuid(cpr).UUID)); Part.ListInputType input = new Part.ListInputType() { UUID = uuids.ToArray() }; var persons = TestRunner.PartService.List(input); Assert.IsNotNull(persons, "List response is null"); Assert.AreEqual("206", persons.StandardRetur.StatusKode); Assert.IsNotNull(persons.LaesResultat, "Persons array is null"); Assert.AreEqual(uuids.Count, persons.LaesResultat.Length, "Incorrect length of returned array"); var partCount = persons.StandardRetur.FejlbeskedTekst.Split(',').Length; Assert.AreEqual(count, partCount); for (int i = 0; i < count; i++) { Assert.NotNull(persons.LaesResultat[i]); Assert.Null(persons.LaesResultat[i].Item); } for (int i = count; i < uuids.Count; i++) { Validate(new Guid(input.UUID[i]), persons.LaesResultat[i], TestRunner.PartService); } }