public void AddUserStatsTest()
        {
            var overallViewModel = new OverallViewModel("1");
            //create user
            var tempUser = CreateUser("User1", "User1", true);

            // must be zero
            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 0);

            //add stats
            AddUserStats(overallViewModel, tempUser, 120, 70, DateTime.Today);

            Assert.True(overallViewModel.GetStats().Count(s => s.User.UserId == "User1") == 1);
            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 120);
        }
Exemple #2
0
        public void AddUserStatsTest()
        {
            var overallViewModel = new OverallViewModel("1");

            var tempUser = new User {
                UserId = "User1", Name = "User1", IsApproved = true
            };

            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 0);

            overallViewModel.AddUserStats(tempUser, 120, 70, DateTime.Today);

            Assert.True(overallViewModel.GetStats().Count(s => s.User.UserId == "User1") == 1);

            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 120);
        }
        public void GetOverallNumberOfRequestsTest()
        {
            var overallViewModel = new OverallViewModel("1");
            // create users
            var tempUser1 = CreateUser("user1", "User1", true);
            var tempUser2 = CreateUser("user2", "User2", true);

            // must be zero
            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 0);

            //add their stats
            AddUserStats(overallViewModel, tempUser1, 120, 70, DateTime.Today);
            AddUserStats(overallViewModel, tempUser2, 60, 60, DateTime.Today);

            // check if all requests are summed
            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 180);
        }
Exemple #4
0
        public void GetOverallNumberOfRequestsTest()
        {
            var overallViewModel = new OverallViewModel("1");

            var tempUser1 = new User {
                UserId = "user1", Name = "User1", IsApproved = true
            };

            var tempUser2 = new User {
                UserId = "user2", Name = "User2", IsApproved = true
            };

            //Must be zero;
            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 0);

            overallViewModel.AddUserStats(tempUser1, 120, 70, DateTime.Today);

            overallViewModel.AddUserStats(tempUser2, 60, 60, DateTime.Today);

            //Check if request of all users are summed;
            Assert.AreEqual(overallViewModel.GetOverallNumberOfRequests(), 180);
        }