public async Task No_Records_Are_Successfully_Created()
        {
            DNSRecordCollection dnsRecords = new DNSRecordCollection(new[]
            {
                new DNSRecord
                {
                    Data = "100.100.100.100",
                    TTL  = 1800,
                    Type = DNSRecordType.A
                },
                new DNSRecord
                {
                    Data = "100.100.100.101",
                    TTL  = 1800,
                    Type = DNSRecordType.A
                },
            });

            IDigitalOceanClient client = A.Fake <IDigitalOceanClient>();

            A.CallTo(() => client.CreateDNSRecordAsync(A <string> .Ignored, A <DigitalOceanCreateDomainRecordRequest> .Ignored, A <string> .Ignored, A <CancellationToken> .Ignored)).Returns(Result.Fail("Error"));

            IDigitalOceanDNSRecordCreator creater = new DigitalOceanDNSRecordCreator(client, _mappingHelper.Mapper);

            Result result = await creater.CreateAsync(string.Empty, dnsRecords, string.Empty, CancellationToken.None);

            A.CallTo(() => client.CreateDNSRecordAsync(A <string> .Ignored, A <DigitalOceanCreateDomainRecordRequest> .Ignored, A <string> .Ignored, A <CancellationToken> .Ignored)).MustHaveHappenedTwiceExactly();
            Assert.True(result.IsFailed);
            Assert.True(result.Errors.Count == 2);
        }
        public async Task <Result> CreateAsync(string domainName, DNSRecordCollection dnsRecords, string token, CancellationToken cancellation)
        {
            Result result = Result.Ok();
            IEnumerable <DigitalOceanCreateDomainRecordRequest> requests = _mapper.Map <IEnumerable <DigitalOceanCreateDomainRecordRequest> >(dnsRecords);

            foreach (DigitalOceanCreateDomainRecordRequest request in requests)
            {
                Result createResult = await _digitalOceanClient.CreateDNSRecordAsync(domainName, request, token, cancellation);

                result = result.Merge(createResult);
            }
            return(result);
        }