Ejemplo n.º 1
0
        //Check that the host is live and it does not return any problem.
        public void CheckHostEnabled()
        {
            var fake = new Mock <IXenConnection>();
            var host = GetHostLiveness(fake, true, false, true);

            //Execute the check
            var check    = new HostLivenessCheck(host);
            var problems = check.RunAllChecks();

            Assert.IsEmpty(problems);
            fake.VerifyAll();
        }
Ejemplo n.º 2
0
        public void CheckHostNotLive()
        {
            var mock = new Mock <IXenConnection>();
            var host = GetHostLiveness(mock, true, false, false);

            //Execute the check
            var check    = new HostLivenessCheck(host);
            var problems = check.RunAllChecks();

            Assert.IsNotEmpty(problems);
            Assert.AreEqual(typeof(HostNotLive), problems[0].GetType());
            mock.VerifyAll();
        }
Ejemplo n.º 3
0
        public void CheckHostDisabled()
        {
            var fake = new Mock <IXenConnection>();
            var host = GetHostLiveness(fake, false, false, true);

            //Execute the check
            var check    = new HostLivenessCheck(host, true);
            var problems = check.RunAllChecks();

            Assert.IsNotEmpty(problems);
            Assert.AreEqual(typeof(HostMaintenanceMode), problems[0].GetType());
            fake.VerifyAll();
        }