HttpResponseMessage Get(AComplexType prm1, AnotherComplexType prm2)
 {
     return new HttpResponseMessage
     {
         Content = new StringContent(prm1.Value + prm2.Value)
     };
 }
Exemplo n.º 2
0
 HttpResponseMessage Get(AComplexType prm1, AnotherComplexType prm2)
 {
     return(new HttpResponseMessage
     {
         Content = new StringContent(prm1.Value + prm2.Value)
     });
 }
Exemplo n.º 3
0
        public void Should_build_object_setting_collection_all_elements_at_once()
        {
            var anObject    = new AnotherComplexType("Robson");
            var otherObject = new AnotherComplexType("Nosbor");

            var createdObject = FluentBuilder <SampleClass>
                                .New()
                                .WithCollection(newObject => newObject.CollectionWithFieldFollowingNameConvention, anObject, otherObject)
                                .Build();

            var expected = new List <AnotherComplexType> {
                anObject, otherObject
            };

            CollectionAssert.AreEqual(expected, createdObject.CollectionWithFieldFollowingNameConvention);
        }
Exemplo n.º 4
0
        public void Should_build_object_setting_different_collections_element_by_element()
        {
            var anObject       = new AnotherComplexType("Robson");
            var integerElement = 1000;

            var createdObject = FluentBuilder <SampleClass>
                                .New()
                                .AddingTo(newObject => newObject.CollectionWithFieldFollowingNameConvention, anObject)
                                .AddingTo(newObject => newObject.AnotherCollection, integerElement)
                                .AddingTo(newObject => newObject.AnotherCollection, integerElement)
                                .Build();

            var expected = new List <AnotherComplexType> {
                anObject
            };
            var expectedIntCollection = new List <int> {
                integerElement, integerElement
            };

            CollectionAssert.AreEqual(expected, createdObject.CollectionWithFieldFollowingNameConvention);
            CollectionAssert.AreEqual(expectedIntCollection, createdObject.AnotherCollection);
        }
 public SendResponse Post([FromBody] AnotherComplexType body)
 {
     return(null);
 }