Ejemplo n.º 1
0
        public void CanAttach_should_throw_execption_if_client_id_is_null()
        {
            var command = new AttachClient();

            ValidationAssert.Throws(() => GuardAppClients.CanAttach(command, App(clients_0)),
                                    new ValidationError("Client ID is required.", "Id"));
        }
Ejemplo n.º 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(command, App(clients_1));
        }
Ejemplo n.º 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");

            ValidationAssert.Throws(() => GuardAppClients.CanAttach(command, App(clients_1)),
                                    new ValidationError("A client with the same id already exists."));
        }