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);
        }
        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);
        }