示例#1
0
        public void CanAttach_should_throw_execption_if_client_id_is_null()
        {
            var command = new AttachClient();

            ValidationAssert.Throws(() => GuardAppClients.CanAttach(clients_0, command),
                                    new ValidationError("Client id is required.", "Id"));
        }
示例#2
0
        public void CanAttach_should_not_throw_exception_if_client_is_free()
        {
            var command = new AttachClient {
                Id = "ios"
            };

            var clients_1 = clients_0.Add("android", "secret");

            GuardAppClients.CanAttach(clients_1, command);
        }
示例#3
0
        public void CanAttach_should_throw_exception_if_client_already_exists()
        {
            var command = new AttachClient {
                Id = "android"
            };

            var clients_1 = clients_0.Add("android", "secret");

            Assert.Throws <ValidationException>(() => GuardAppClients.CanAttach(clients_1, command));
        }
示例#4
0
        public void CanAttach_should_throw_exception_if_client_already_exists()
        {
            var command = new AttachClient {
                Id = "android"
            };

            var clients_1 = clients_0.Add("android", "secret");

            ValidationAssert.Throws(() => GuardAppClients.CanAttach(clients_1, command),
                                    new ValidationError("A client with the same id already exists."));
        }
示例#5
0
        public void CanAttach_should_throw_execption_if_client_id_is_null()
        {
            var command = new AttachClient();

            Assert.Throws <ValidationException>(() => GuardAppClients.CanAttach(clients_0, command));
        }