Example #1
0
        public void CheckInPercentTest()
        {
            CheckInManager manager = new CheckInManager();

            Assert.AreEqual(1, manager.CheckInResult.CheckInCount);

            CheckInManager.CheckInStatusTypes result = manager.CheckIn("user1", true);
            Assert.AreEqual(result, CheckInManager.CheckInStatusTypes.Duplicate);
            Assert.AreEqual(1, manager.CheckInResult.CheckInCount);

            Assert.AreEqual(50, manager.CheckInResult.CheckInByAIPercent);
            Assert.AreEqual(50, manager.CheckInResult.CheckInByAdminPercent);

            result = manager.CheckIn("user2", true);
            Assert.AreEqual(result, CheckInManager.CheckInStatusTypes.Success);
            Assert.AreEqual(2, manager.CheckInResult.CheckInCount);

            Assert.AreEqual(50, manager.CheckInResult.CheckInByAIPercent);
            Assert.AreEqual(50, manager.CheckInResult.CheckInByAdminPercent);

            result = manager.CheckIn("user3", true);
            Assert.AreEqual(result, CheckInManager.CheckInStatusTypes.Unknown);
            Assert.AreEqual(2, manager.CheckInResult.CheckInCount);

            Assert.AreEqual(2, manager.CheckInResult.TotalCount);
        }
Example #2
0
        public void CheckInTest()
        {
            CheckInManager manager = new CheckInManager();

            CheckInManager.CheckInStatusTypes result = manager.CheckIn("user1", false);
            Assert.AreEqual(result, CheckInManager.CheckInStatusTypes.Duplicate);

            result = manager.CheckIn("user2", true);
            Assert.AreEqual(result, CheckInManager.CheckInStatusTypes.Success);

            result = manager.CheckIn("user3", true);
            Assert.AreEqual(result, CheckInManager.CheckInStatusTypes.Unknown);
        }