Пример #1
0
        /// <summary>
        /// Configure the window when automatic maintenance should be performed
        /// </summary>
        public Task Maintenance(string databaseId, Models.Requests.MaintenanceWindow window)
        {
            var parameters = new List <Parameter> {
                new Parameter("id", databaseId, ParameterType.UrlSegment)
            };

            return(_connection.ExecuteRaw("databases/{id}/maintenance", parameters, window, Method.POST));
        }
        public void CorrectRequestForMaintenance()
        {
            var factory = Substitute.For <IConnection>();
            var client  = new DatabasesClient(factory);

            var maintenance = new Models.Requests.MaintenanceWindow();

            client.Maintenance("1", maintenance);

            var parameters = Arg.Is <List <Parameter> >(list => (string)list[0].Value == "1");

            factory.Received().ExecuteRaw("databases/{id}/maintenance", parameters, maintenance, Method.POST);
        }