Ejemplo n.º 1
0
        public void Can_POST_CsvDto()
        {
            var client = new CsvServiceClient(Config.ListeningOn);

            var dto = new CsvDtoEnumerable
            {
                Id    = 1,
                Name  = "Name",
                Items = 3.Times(x => CreateCsvItem(x))
            };

            var response = client.Post(dto);

            Assert.That(response.Id, Is.EqualTo(0));
            Assert.That(response.Name, Is.Null);
            Assert.That(response.Items, Is.EquivalentTo(dto.Items));

            response = Config.ListeningOn.CombineWith("csvdto")
                       .PostCsvToUrl(dto)
                       .FromCsv <CsvDtoEnumerable>();
            Assert.That(response.Id, Is.EqualTo(0));
            Assert.That(response.Name, Is.Null);
            Assert.That(response.Items, Is.EquivalentTo(dto.Items));
        }
Ejemplo n.º 2
0
 public object Any(CsvDtoEnumerable request)
 {
     return(request);
 }