Beispiel #1
0
        public void MiddleTier_GetArrayPatient()
        {
            Patient[]     arrayPat  = WebServiceTests.GetArrayPatient();
            List <string> strErrors = new List <string>();

            if (arrayPat == null || arrayPat.Length < 2)
            {
                strErrors.Add(arrayPat == null?"The patient array is null.":"The patient array contains an insufficient number of patients.");
            }
            else
            {
                if (arrayPat[0] == null || arrayPat[0].LName != "Jones")
                {
                    strErrors.Add(string.Format("The patient in the array should have the LName {0} but returned {1}.", "Jones",
                                                arrayPat[0] == null?"a null patient":arrayPat[0].LName ?? "a null LName"));
                }
                if (arrayPat[0] == null || arrayPat[0].AddrNote != WebServiceTests.DirtyString)
                {
                    strErrors.Add(string.Format(@"The patient in the array should have the AddrNote {0} but returned {1}.", WebServiceTests.DirtyString,
                                                arrayPat[0] == null?"a null patient":arrayPat[0].AddrNote ?? "a null AddrNote"));
                }
                if (arrayPat[1] != null)
                {
                    strErrors.Add("The patient array should contain a null patient but returned a non-null patient.");
                }
            }
            Assert.IsTrue(strErrors.Count == 0);
        }