Ejemplo n.º 1
0
 public void NotSystemAdminTest()
 {
     userAdminMocker.Setup(x => x.GetAdminName()).Returns("Moshe");
     userAdminMocker.Setup(x => x.ValidateSystemAdmin()).Throws(new MarketException((int)ViewSystemLogStatus.NotSystemAdmin, ""));
     adminDbMocker.Setup(x => x.IsUserExist(It.IsAny <string>())).Returns(true);
     slave = new ViewLogSlave(adminDbMocker.Object, userAdminMocker.Object);
     slave.ViewLog();
     Assert.AreEqual((int)ViewSystemLogStatus.NotSystemAdmin, slave.Answer.Status);
 }
Ejemplo n.º 2
0
        public void ViewEventLogsSuccessTest()
        {
            userAdminMocker.Setup(x => x.GetAdminName()).Returns("Moshe");
            adminDbMocker.Setup(x => x.IsUserExist(It.IsAny <string>())).Returns(true);
            slave = new ViewLogSlave(adminDbMocker.Object, userAdminMocker.Object);
            slave.ViewLog();
            Assert.AreEqual((int)ViewSystemLogStatus.Success, slave.Answer.Status);
            var actual = slave.Answer.ReportList;

            Assert.AreEqual(expectedEvents.Length, actual.Length);
            for (int i = 0; i < expectedEvents.Length; i++)
            {
                Assert.AreEqual(expectedEvents[i], actual[i]);
            }
        }