예제 #1
0
        public void GetStatsTest()
        {
            var overallViewModel = new OverallViewModel("1");

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

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

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

            Assert.True(overallViewModel.GetStats().Count(s => s.User.UserId == "user15") == 0);
        }
예제 #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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void GetStatsTest()
        {
            var overallViewModel = new OverallViewModel("1");
            //create user
            var tempUser = CreateUser("user1", "User1", true );

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

            Assert.True(overallViewModel.GetStats().Count(s => s.User.UserId == "user1") == 1);
            Assert.True(overallViewModel.GetStats().Count(s => s.User.UserId == "user15") == 0);
        }