コード例 #1
0
        public void add_rent_every_day_for_1_civilian()
        {
            CivPopRepository repo = new CivPopRepository();

            repo.Add(new CivPopVessel("vessel"));

            CivPopKerbal valentina = new CivPopKerbal("Valentina", CivPopKerbalGender.FEMALE, 0, true);

            repo.Add(valentina);
            valentina.SetVesselId("vessel");

            CivPopKerbal bill = new CivPopKerbal("Bill", CivPopKerbalGender.MALE, 0, false);

            repo.Add(bill);
            bill.SetVesselId("vessel");

            CivPopServiceRent service = new CivPopServiceRent();

            double date = 0;

            service.Update(date, repo);
            Assert.AreEqual(0, repo.GetFunds());

            date += 60 * 60;
            service.Update(date, repo);
            Assert.AreEqual(0, repo.GetFunds());

            date += TimeUnit.DAY;
            service.Update(date, repo);
            Assert.AreEqual(200, repo.GetFunds());

            date += TimeUnit.DAY;
            service.Update(date, repo);
            Assert.AreEqual(400, repo.GetFunds());
        }
コード例 #2
0
        public void not_add_rent_for_1_civilians_on_KSC()
        {
            CivPopRepository repo = new CivPopRepository();

            repo.Add(new CivPopKerbal("Valentina", CivPopKerbalGender.FEMALE, 0, true));

            CivPopServiceRent service = new CivPopServiceRent();

            double date = 0;

            service.Update(date, repo);
            Assert.AreEqual(0, repo.GetFunds());

            date += 60 * 60;
            service.Update(date, repo);
            Assert.AreEqual(0, repo.GetFunds());

            date += TimeUnit.DAY;
            service.Update(date, repo);
            Assert.AreEqual(0, repo.GetFunds());

            date += TimeUnit.DAY;
            service.Update(date, repo);
            Assert.AreEqual(0, repo.GetFunds());
        }