Exemplo n.º 1
0
        public void Should_ReturnStateIdString_When_CallToString()
        {
            var en = new WuEnviroment("a", "a", "a", "a", TimeSpan.Zero, 10);
            StateDescription sd = new StateDescription(WuStateId.DownloadCompleted, "name", "desc", InstallerStatus.Busy, en);

            Assert.AreEqual(sd.ToString(), WuStateId.DownloadCompleted.ToString("G"));
        }
Exemplo n.º 2
0
        public void Should_ReturnTrue_When_CompareStateId()
        {
            var en = new WuEnviroment("a", "a", "a", "a", TimeSpan.Zero, 10);
            StateDescription sd = new StateDescription(WuStateId.Installing, "name", "", InstallerStatus.Busy, en);

            Assert.IsTrue(sd.Equals(WuStateId.Installing));
        }
Exemplo n.º 3
0
        public void Should_NotAllowEmptyDisplayName_When_CreateStateDescription()
        {
            var en = new WuEnviroment("a", "a", "a", "a", TimeSpan.Zero, 10);

            try
            {
                StateDescription sd = new StateDescription(WuStateId.Installing, "", "", InstallerStatus.Busy, en);
                Assert.Fail("exception expected");
            }
            catch (ArgumentException) { }

            try
            {
                StateDescription sd = new StateDescription(WuStateId.Installing, " ", "", InstallerStatus.Busy, en);
                Assert.Fail("exception expected");
            }
            catch (ArgumentException) { }

            try
            {
                StateDescription sd = new StateDescription(WuStateId.Installing, null, "", InstallerStatus.Busy, en);
                Assert.Fail("exception expected");
            }
            catch (ArgumentException) { }
        }
Exemplo n.º 4
0
        public void Should_ContainSpecifiedValues_When_CreateWuEnviroment()
        {
            string   fqdn = "fqdn", os = "osname", updateserver = "update server", target = "target group";
            TimeSpan uptime    = new TimeSpan(1, 0, 0);
            long     freespace = 10;
            var      env       = new WuEnviroment(fqdn, os, updateserver, target, uptime, freespace);

            Assert.AreEqual(env.FQDN, fqdn);
            Assert.AreEqual(env.OperatingSystemName, os);
            Assert.AreEqual(env.UpdateServer, updateserver);
            Assert.AreEqual(env.TargetGroup, target);
            Assert.AreEqual(env.UpTime, uptime);
            Assert.AreEqual(env.FreeSpace, freespace);
        }
Exemplo n.º 5
0
        public void Should_NotAcceptNullValues_When_CreateWuEnviroment()
        {
            string   fqdn = "fqdn", os = "osname", updateserver = "update server", target = "target group";
            TimeSpan uptime    = new TimeSpan(1, 0, 0);
            long     freespace = 10;
            var      env       = new WuEnviroment(fqdn, os, updateserver, target, uptime, freespace);

            try
            {
                new WuEnviroment(null, os, updateserver, target, uptime, freespace);
                Assert.Fail("exception expected");
            }
            catch (ArgumentNullException) { }

            try
            {
                new WuEnviroment(" ", os, updateserver, target, uptime, freespace);
                Assert.Fail("exception expected");
            }
            catch (ArgumentNullException) { }

            try
            {
                new WuEnviroment(fqdn, null, updateserver, target, uptime, freespace);
                Assert.Fail("exception expected");
            }
            catch (ArgumentNullException) { }

            try
            {
                new WuEnviroment(fqdn, " ", updateserver, target, uptime, freespace);
                Assert.Fail("exception expected");
            }
            catch (ArgumentNullException) { }

            try
            {
                new WuEnviroment(fqdn, os, null, target, uptime, freespace);
                Assert.Fail("exception expected");
            }
            catch (ArgumentNullException) { }

            try
            {
                new WuEnviroment(fqdn, os, updateserver, null, uptime, freespace);
                Assert.Fail("exception expected");
            }
            catch (ArgumentNullException) { }
        }
Exemplo n.º 6
0
        public void Should_ContainSpecifiedValues_When_CreateStateDescription()
        {
            ProgressDescription pd = new ProgressDescription();
            string name            = "name";
            string desc            = "desc";
            var    insts           = InstallerStatus.Busy;
            var    en = new WuEnviroment("a", "a", "a", "a", TimeSpan.Zero, 10);

            StateDescription sd = new StateDescription(WuStateId.Installing, name, desc, insts, en, pd);

            Assert.AreEqual(name, sd.DisplayName);
            Assert.AreEqual(desc, sd.Description);
            Assert.AreEqual(WuStateId.Installing, sd.StateId);
            Assert.AreEqual(insts, sd.InstallerStatus);
            Assert.AreSame(pd, sd.Progress);
            Assert.AreSame(en, sd.Enviroment);
        }