예제 #1
0
        public void TestNullValues(
            [ValueSource("CprCounts")] int count)
        {
            string[] cprNumbers = new string[count];
            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;
            var    ret = client.GetObjectIDsFromCprArray("", cprNumbers.ToArray(), ref aux);

            Assert.NotNull(ret, "Output array is null");
            Assert.AreEqual(count, ret.Length);
        }
예제 #2
0
        public void TestGetCPRsFromArrayOfobjectIDsWithNullValues([ValueSource("CprCounts")] int count)
        {
            var cprNumbers = new String[count];

            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;
            var    ret = client.GetCPRsFromObjectIDArray("", cprNumbers.ToArray(), ref aux);

            Assert.NotNull(aux, "Aux is null");
            Assert.AreEqual(count, ret.Length);
        }
예제 #3
0
        public void TestGetUuidArrayOfCprSequence(
            [ValueSource("CprCounts")] int count)
        {
            var cprNumbers = SerialCprNumbers(count);

            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;

            var ret = client.GetObjectIDsFromCprArray("", cprNumbers.ToArray(), ref aux);

            ValidateOutput(cprNumbers, ret);
        }
예제 #4
0
        public void TestGetCPRsFromArrayOfobjectIDsWithRandomIDs([ValueSource("CprCounts")] int count)
        {
            var objectIDs = RandomObjectIDs(count);

            System.Diagnostics.Debug.WriteLine("TEST random, #: " + count);
            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;

            var ret = client.GetCPRsFromObjectIDArray("", objectIDs.ToArray(), ref aux);

            //ValidateOutput(objectIDs, ret);
            System.Diagnostics.Debug.WriteLine("Returned random (" + count + ") IDs: " + ret.Length);
        }
예제 #5
0
        public void GetCPRsFromObjectIDArrays_RandomPNR_SmePNRs([ValueSource("CprCounts")] int count)
        {
            var cprNumbers = RandomCprNumbers(count);

            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;

            System.Diagnostics.Debug.WriteLine("TEST random, #: " + count);
            var objectIDs = client.GetObjectIDsFromCprArray("", cprNumbers, ref aux);

            var ret = client.GetCPRsFromObjectIDArray("", objectIDs.Select(id => id.ToString()).ToArray(), ref aux);

            for (int i = 0; i < count; i++)
            {
                Assert.AreEqual(cprNumbers[i], ret[i], "Different CPR number at index " + i);
            }
        }
예제 #6
0
        public void TestGetCPRsFromArrayOfobjectIDsWithInvalidIDs([ValueSource("CprCounts")] int count)
        {
            var cprNumbers = InvalidObjectIDs(count);

            System.Diagnostics.Debug.WriteLine("TEST invalid, #: " + count);
            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;
            var    ret = client.GetCPRsFromObjectIDArray("", cprNumbers.ToArray(), ref aux);

            Assert.NotNull(aux, "Aux is null");
            if (count > 0)
            {
                Assert.Greater(aux.Length, 0, "Aux is empty");
            }
            for (int i = 0; i < count; i++)
            {
                Assert.IsNull(ret[i], string.Format("Cpr number {0} did not fail", cprNumbers[i]));
            }
            System.Diagnostics.Debug.WriteLine("Returned invalid (" + count + ") IDs: " + ret.Length);
        }
예제 #7
0
        public void TestInvalidCprNumbers(
            [ValueSource("CprCounts")] int count)
        {
            var cprNumbers = InvalidCprNumbers(count);

            PersonMasterServiceLibrary.BasicOpClient client = new PersonMasterServiceLibrary.BasicOpClient();
            string aux = null;
            var    ret = client.GetObjectIDsFromCprArray("", cprNumbers.ToArray(), ref aux);

            Assert.NotNull(aux, "Aux is null");
            Console.WriteLine(aux);
            if (count > 0)
            {
                Assert.Greater(aux.Length, 0, "Aux is empty");
            }
            for (int i = 0; i < count; i++)
            {
                Assert.IsNull(ret[i], string.Format("Cpr number {0} did not fail", cprNumbers[i]));
            }
        }