public Application Get(int id)
        {
            var applicationAccess = new ApplicationAccess();
            var applicationDB     = applicationAccess.Get(id);

            return(DBToLogic(applicationDB));
        }
Exemple #2
0
        public void GetApplicationByIdTest()
        {
            var applicationExpected = applicationAccess.Get("Test Message");
            var applicationActual   = applicationAccess.Get(applicationExpected.ID);

            Assert.AreEqual(applicationExpected.BandID, applicationActual.BandID);
        }
        public void Add(Application application)
        {
            var applicationAccess = new ApplicationAccess();
            var applicationDB     = applicationAccess.Get(application.ID);

            if (applicationDB == null)
            {
                applicationAccess.Add(LogicToDB(application));
            }
        }
        public List <Application> Get()
        {
            var applicationAccess = new ApplicationAccess();
            var applicationsDB    = applicationAccess.Get();
            var applicationsLogic = new List <Application>();

            for (int i = 0; i < applicationsDB.Count; i++)
            {
                applicationsLogic.Add(DBToLogic(applicationsDB[i]));
            }

            return(applicationsLogic);
        }
Exemple #5
0
        public void AddApplicationTest()
        {
            var application = new Application();

            application.Sent    = DateTime.Now;
            application.Message = "Test Message";
            application.Result  = true;
            application.BandID  = bandController.Get("")[0].ID;
            application.UserID  = userController.Get("")[0].ID;

            applicationController.Add(application);

            var application2 = applicationAccess.Get(application.Message);

            Assert.AreEqual(application2.Message, application.Message);
        }