Exemplo n.º 1
0
        public void GetTopMakelaars_2()
        {
            List <CKoopWoning>          oWoningen = new List <CKoopWoning>();
            CAPI_TestData               oAPI      = new CAPI_TestData();
            IAPIParser_KoopWoningParser oParser   = new CAPIParser_KoopWoningXML();
            IGet_TopNMakelaars          oReport   = new CGet_TopNMakelaars(oAPI, oParser);
            List <CMakelaar>            oMakelaars;

            // 3 Houses
            oWoningen.Add(new CKoopWoning("a", 1, "Makelaar_1"));
            oWoningen.Add(new CKoopWoning("b", 2, "Makelaar_2"));
            oWoningen.Add(new CKoopWoning("c", 1, "Makelaar_1"));

            oAPI.AddData(1, 25, CreateXML(oWoningen.Count, oWoningen));
            oAPI.AddData(2, 25, CreateXML(0, new List <CKoopWoning>()));

            oMakelaars = oReport.GetTopNMakelaars("/amsterdam/", 2);

            Assert.AreEqual(oMakelaars.Count, 2, "GetTopMakelaars 'Top 2' Failed");
            Assert.AreEqual(oMakelaars[0].MakelaarID, 1, "GetTopMakelaars 'Top 2' Failed");
            Assert.AreEqual(oMakelaars[0].MakelaarName, "Makelaar_1", "GetTopMakelaars 'Top 2' Failed");
            Assert.AreEqual(oMakelaars[0].NumWoningen, 2, "GetTopMakelaars 'Top 2' Failed");
            Assert.AreEqual(oMakelaars[1].MakelaarID, 2, "GetTopMakelaars 'Top 2' Failed");
            Assert.AreEqual(oMakelaars[1].MakelaarName, "Makelaar_2", "GetTopMakelaars 'Top 2' Failed");
            Assert.AreEqual(oMakelaars[1].NumWoningen, 1, "GetTopMakelaars 'Top 2' Failed");
        }
Exemplo n.º 2
0
        public void GetTopMakelaars_0()
        {
            List <CKoopWoning>          oWoningen = new List <CKoopWoning>();
            CAPI_TestData               oAPI      = new CAPI_TestData();
            IAPIParser_KoopWoningParser oParser   = new CAPIParser_KoopWoningXML();
            IGet_TopNMakelaars          oReport   = new CGet_TopNMakelaars(oAPI, oParser);
            List <CMakelaar>            oMakelaars;

            oAPI.AddData(1, 25, CreateXML(oWoningen.Count, oWoningen));

            oMakelaars = oReport.GetTopNMakelaars("/amsterdam/", 10);

            Assert.AreEqual(oMakelaars.Count, 0, "GetTopMakelaars '0 Houses' Failed");
        }