public void CustomerId15_NotIncludeProjects()
        {
            _databaseSetup.CreateCustomer(15, "New test Customer", "*****@*****.**", "Me", "Street", "City", "Country",
                                          "ZipCode");
            _databaseSetup.CreateProject(15, 15, "testproj", 1, "01-01-2012", false, null, 1);

            var newCustomer = _customerServices.GetCustomerById(15, false, false, false, false, false);

            Assert.IsEmpty(newCustomer.Projects);
        }
Exemple #2
0
        public void ProjectWithId15_ProjectWithId15()
        {
            _databaseSetup.CreateProject(15, 1, "new proj", 1, "01-01-2013", false, null, 1);
            var newProj = _projectService.GetProjectById(15, false, false, false, false);

            Assert.AreEqual(15, newProj.ProjectID);
        }
Exemple #3
0
        public void TestAfUpdate()
        {
            _databaseSetup.CreateProject(15, 1, "test", 1, "01-01-2013", true, 100000, 1);
            _databaseSetup.CreateTask(15, 15, 1, "01-01-2012", "test");

            _databaseSetup.CreateTimeEntry(15, null, 100, 100, true, 100, 0, "01-01-2012", "01-01-2012", 1, 15, 1);
            _databaseSetup.CreateTimeEntry(16, null, 100, 100, true, 100, 0, "01-01-2012", "01-01-2012", 1, 15, 1);
            _databaseSetup.CreateTimeEntry(17, null, 100, 100, true, 100, 0, "01-01-2012", "01-01-2012", 1, 15, 1);
            _databaseSetup.CreateTimeEntry(18, null, 100, 100, true, 100, 0, "01-01-2012", "01-01-2012", 1, 15, 1);
            _databaseSetup.CreateTimeEntry(19, null, 100, 100, true, 100, 0, "01-01-2012", "01-01-2012", 1, 15, 1);

            var timeEntriesold = (from timeEntry in _databaseSetup.GetTrexConnection.TrexEntityContext.TimeEntries
                                  where
                                  timeEntry.TimeEntryID == 15 || timeEntry.TimeEntryID == 16 ||
                                  timeEntry.TimeEntryID == 17 || timeEntry.TimeEntryID == 18 ||
                                  timeEntry.TimeEntryID == 19
                                  select timeEntry);

            foreach (var timeEntry in timeEntriesold)
            {
                Assert.AreEqual(100, timeEntry.Price);
            }

            _timeEntryService.UpdateTimeEntryPrice(15);

            var timeEntriesNew = (from timeEntry in _databaseSetup.GetTrexConnection.TrexEntityContext.TimeEntries
                                  where
                                  timeEntry.TimeEntryID == 15 || timeEntry.TimeEntryID == 16 ||
                                  timeEntry.TimeEntryID == 17 || timeEntry.TimeEntryID == 18 ||
                                  timeEntry.TimeEntryID == 19
                                  select timeEntry);

            foreach (var timeEntry in timeEntriesNew)
            {
                Assert.AreEqual(200, timeEntry.Price);
            }
        }