Beispiel #1
0
        public void Save_Without_Contact_Person()
        {
            SolaApplicationService appSvc = new SolaApplicationService();

            appSvc.app.UserId = "1324";
            appSvc.save();
            Assert.AreEqual(appSvc.app.Status, "Incomplete");
            Assert.IsFalse(appSvc.isComplete());
        }
Beispiel #2
0
        public void Submit_Without_User_Application()
        {
            SolaApplicationService appSvc = new SolaApplicationService();

            appSvc.SubmitToSola();
            Assert.AreEqual(appSvc.app.Status, "No User");
            Assert.IsNull(appSvc.app.SolaId);
            Assert.IsFalse(appSvc.isComplete());
        }
Beispiel #3
0
        public void Test_Save_Application()
        {
            SolaApplicationService SolaAppSvc = new SolaApplicationService();
            Application            app        = SolaAppSvc.app;

            app.UserId              = "e911miri";
            app.ContactPerson.DOB   = DateTime.Today;
            app.ContactPerson.Email = "*****@*****.**";

            app.Properties.Add(new Property()
            {
                Developed = false,
                LandUse   = "Cultivating of Home grown Cashew Trees"
            });

            //Application is still detached in this case
            Assert.AreEqual(app.EntityState, EntityState.Detached);
            SolaAppSvc.save();

            //Application should have an entity key
            Assert.IsNotNull(app.EntityKey);

            //Application should have an unchanged state after save
            Assert.AreEqual(app.EntityState, EntityState.Unchanged);

            //Application should exist in the database
            Assert.IsNotNull(SolaAppSvc.getApplicationById(app.Id));

            //Application Id should not be changed during the save process
            Assert.AreEqual(app.Id, SolaAppSvc.getApplicationById(app.Id).Id);

            //The Application should have a contact person
            Assert.IsNotNull(app.ContactPerson);

            //There should be only one party and one property attached to this application
            Assert.IsTrue(app.Parties.Count == 1);
            Assert.IsTrue(app.Properties.Count == 1);

            Assert.IsFalse(SolaAppSvc.isComplete());
        }