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

            var dto = new CsvFirstEnumerable
            {
                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("csvfirst")
                       .PostCsvToUrl(dto)
                       .FromCsv <CsvFirstEnumerable>();
            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(CsvFirstEnumerable request)
 {
     return(request);
 }