Exemplo n.º 1
0
        public void GetMissingLoggingPolicy()
        {
            var service = new TestLoggingPolicyService()
            {
                GetLoggingPolicyAction = () => null,
            };

            var cmd    = new GetLoggingPolicyCommand(service);
            var output = cmd.Invoke <string>();

            Assert.IsNotNull(output);
            Assert.AreEqual <int>(0, output.Count());
        }
Exemplo n.º 2
0
        public void GetLoggingPolicy()
        {
            var expected = new string[]
            {
                "FatalExit",
                "Error",
                "Warning",
                "User",
                "Information",
                "OutOfDiskSpace",
                "ActionStart",
                "ActionData",
                "PropertyDump",
                "CommonData",
                "Verbose",
                "ExtraDebug",
            };

            var service = new TestLoggingPolicyService()
            {
                GetLoggingPolicyAction = () => "voicewarmupx",
            };

            var cmd    = new GetLoggingPolicyCommand(service);
            var output = cmd.Invoke <string>();

            Assert.IsNotNull(output);
            CollectionAssert.AreEquivalent(expected, output.ToArray());

            cmd = new GetLoggingPolicyCommand(service)
            {
                Raw = true,
            };
            output = cmd.Invoke <string>();

            Assert.IsNotNull(output);
            Assert.AreEqual("voicewarmupx", output.FirstOrDefault());
        }