public void TestSuccess() {
            var protocols = new ProtocolController();

            ICommandResult result = protocols.Tunnel(CommandBuilder.ProtocolsFetchSupportedProtocols().SetOrigin(CommandOrigin.Local));

            Assert.IsTrue(result.Success);
            Assert.AreEqual(CommandResultType.Success, result.CommandResultType);
        }
        public void TestInsufficientPermissions() {
            var protocols = new ProtocolController();

            ICommandResult result = protocols.Tunnel(CommandBuilder.ProtocolsCheckSupportedProtocol("Myrcon", CommonProtocolType.DiceBattlefield4).SetOrigin(CommandOrigin.Remote).SetAuthentication(new CommandAuthenticationModel() {
                Username = "******"
            }));

            Assert.IsFalse(result.Success);
            Assert.AreEqual(CommandResultType.InsufficientPermissions, result.CommandResultType);
        }
        public void TestProtocolTypesReturned() {
            var item = new ProtocolType() {
                Name = "Battlefield 4",
                Provider = "Myrcon",
                Type = "DiceBattlefield4"
            };
            
            var protocols = new ProtocolController {
                Protocols = new List<IProtocolAssemblyMetadata>() {
                    new ProtocolAssemblyMetadata() {
                        ProtocolTypes = new List<IProtocolType>() {
                            item
                        }
                    }
                }
            };

            ICommandResult result = protocols.Tunnel(CommandBuilder.ProtocolsFetchSupportedProtocols().SetOrigin(CommandOrigin.Local));

            Assert.AreEqual(item, result.Now.ProtocolTypes.First());
        }
        public void TestSuccess() {
            var item = new ProtocolType() {
                Name = "Battlefield 4",
                Provider = "Myrcon",
                Type = CommonProtocolType.DiceBattlefield4
            };

            var protocols = new ProtocolController {
                Protocols = new List<IProtocolAssemblyMetadata>() {
                    new ProtocolAssemblyMetadata() {
                        ProtocolTypes = new List<IProtocolType>() {
                            item
                        }
                    }
                }
            };

            ICommandResult result = protocols.Tunnel(CommandBuilder.ProtocolsCheckSupportedProtocol("Myrcon", CommonProtocolType.DiceBattlefield4).SetOrigin(CommandOrigin.Local));

            Assert.IsTrue(result.Success);
            Assert.AreEqual(CommandResultType.Success, result.CommandResultType);
        }
        public void TestFailureDoesNotExist() {
            var protocols = new ProtocolController();

            ICommandResult result = protocols.Tunnel(CommandBuilder.ProtocolsCheckSupportedProtocol("Myrcon", CommonProtocolType.DiceBattlefield4).SetOrigin(CommandOrigin.Local));

            Assert.IsFalse(result.Success);
            Assert.AreEqual(CommandResultType.DoesNotExists, result.CommandResultType);
        }