Esempio n. 1
0
        public void MiddleTier_GetListPats()
        {
            List <Patient> listPats  = WebServiceTests.GetListPats();
            List <string>  strErrors = new List <string>();

            if (listPats == null)
            {
                strErrors.Add("The list of patients returned is null.");
            }
            else
            {
                if (listPats[0].FName != null)
                {
                    strErrors.Add("The first patient in the list of patients FName should be null but returned '" + listPats[0].FName + "'.");
                }
                if (listPats[0].LName != "Smith")
                {
                    strErrors.Add("The first patient in the list of patients LName should be 'Smith' but returned " + (listPats[0].LName == null ? "null" : ("'" + listPats[0].LName + "'")) + "'.");
                }
                if (listPats[0].AddrNote != WebServiceTests.DirtyString)
                {
                    strErrors.Add(string.Format(@"The first patient in the list of patients AddrNote should be '{0}' but returned {1}.", WebServiceTests.DirtyString,
                                                listPats[0].AddrNote == null ? "null" : ("'" + listPats[0].AddrNote + "'")));
                }
            }
            Assert.AreEqual(0, strErrors.Count);
        }