public async Task <Item> MethodWithSameName(string resultItemName)
        {
            var item = await ItemsGenerator.GenerateItem().ConfigureAwait(false);

            item.Name = resultItemName;
            return(item);
        }
Пример #2
0
        private async Task <bool> IsItemCorrect(Item item)
        {
            var expectedItem = await ItemsGenerator.GenerateItem();

            var isItemCorrect = expectedItem.Equals(item);

            return(isItemCorrect);
        }
Пример #3
0
        public async Task TestItemResult()
        {
            var result = await _controller.ItemResult();

            var expectedItem = await ItemsGenerator.GenerateItem();

            Assert.Equal(expectedItem, result);
        }
Пример #4
0
        public async Task TestNoPathWithBodyParameter()
        {
            var item = await ItemsGenerator.GenerateItem();

            var result = await _service.EmptyPathWithBodyParameter(item);

            Assert.True(result);
        }
Пример #5
0
        public async Task TestBodyParameterAsLastParameter(FormatterSelection formatter)
        {
            var client       = Client <ISerializeParameterController>(formatter);
            var expectedItem = await ItemsGenerator.GenerateItem();

            var actualItem = await client.GetItemBodyParameterAsLastParameter(ItemsGenerator.TestGuid, "Test", expectedItem);

            Assert.Equal(expectedItem, actualItem);
        }
Пример #6
0
        public async Task TestBodyParameterWithNoAttribute(FormatterSelection formatter)
        {
            var client       = Client <ISerializeParameterController>(formatter);
            var expectedItem = await ItemsGenerator.GenerateItem();

            var actualItem = await client.GetItemBodyParameterWithNoAttribute(expectedItem);

            Assert.NotEqual(expectedItem, actualItem);
        }
Пример #7
0
        public async Task TestNoPathWithAllParameterTypes()
        {
            var item = await ItemsGenerator.GenerateItem();

            var result = await _service.EmptyPathWithAllParameters(
                item,
                ItemsGenerator.TestString, ItemsGenerator.TestInt, ItemsGenerator.TestGuid, ItemsGenerator.TestDate,
                ItemsGenerator.TestString, ItemsGenerator.TestInt, ItemsGenerator.TestGuid, ItemsGenerator.TestDate);

            Assert.True(result);
        }
        public async Task TestMethodsWithSameNames()
        {
            var item = await _controller.MethodWithSameName();

            var expectedItem = await ItemsGenerator.GenerateItem();

            Assert.Equal(expectedItem, item);

            var resultItemName = "ResultItemName";
            var resultItem     = await _controller.MethodWithSameName(resultItemName);

            Assert.Equal(resultItemName, resultItem.Name);
        }
 public async Task<Item> MethodWithSameUrl2()
 {
     var item = await ItemsGenerator.GenerateItem().ConfigureAwait(false);
     return item;
 }
Пример #10
0
        public async Task <Item> ItemResult()
        {
            var item = await ItemsGenerator.GenerateItem();

            return(item);
        }