Inheritance: IImagesClient
        public void CorrectRequestForDelete() {
            var factory = Substitute.For<IConnection>();
            var client = new ImagesClient(factory);

            client.Delete(9001);

            var parameters = Arg.Is<List<Parameter>>(list => (int)list[0].Value == 9001);
            factory.Received().ExecuteRaw("images/{id}", parameters, Method.DELETE);
        }
        public void CorrectRequestForGetSlug() {
            var factory = Substitute.For<IConnection>();
            var client = new ImagesClient(factory);

            client.Get("testing");

            var parameters = Arg.Is<List<Parameter>>(list => (string)list[0].Value == "testing");
            factory.Received().ExecuteRequest<Image>("images/{id}", parameters, null, "image");
        }
        public void CorrectRequestForUpdate() {
            var factory = Substitute.For<IConnection>();
            var client = new ImagesClient(factory);

            var body = new Models.Requests.Image { Name = "example" };
            client.Update(9001, body);

            var parameters = Arg.Is<List<Parameter>>(list => (int)list[0].Value == 9001);
            factory.Received().ExecuteRequest<Image>("images/{id}", parameters, body, "image", Method.PUT);
        }
        public void CorrectRequestForGetAll() {
            var factory = Substitute.For<IConnection>();
            var client = new ImagesClient(factory);

            client.GetAll();
            factory.Received().GetPaginated<Image>("images", null, "images");

            client.GetAll(ImageType.Application);
            factory.Received().GetPaginated<Image>("images?type=application", null, "images");

            client.GetAll(ImageType.Distribution);
            factory.Received().GetPaginated<Image>("images?type=distribution", null, "images");

            client.GetAll(ImageType.Private);
            factory.Received().GetPaginated<Image>("images?private=true", null, "images");
        }
        public DigitalOceanClient(string token) {
            var client = new RestClient(DigitalOceanApiUrl) {
                UserAgent = "digitalocean-api-dotnet"
            };
            client.AddDefaultHeader("Authorization", string.Format("Bearer {0}", token));

            _connection = new Connection(client);

            Actions = new ActionsClient(_connection);
            DomainRecords = new DomainRecordsClient(_connection);
            Domains = new DomainsClient(_connection);
            DropletActions = new DropletActionsClient(_connection);
            Droplets = new DropletsClient(_connection);
            ImageActions = new ImageActionsClient(_connection);
            Images = new ImagesClient(_connection);
            Keys = new KeysClient(_connection);
            Regions = new RegionsClient(_connection);
            Sizes = new SizesClient(_connection);
        }