Get() private method

private Get ( ) : ActionResult>
return ActionResult>
        public void GetById() {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            string result = controller.Get(5);

            // Assert
            Assert.AreEqual("value", result);
        }
        public void GetById()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            string result = controller.Get(5);

            // Assert
            Assert.That("value", Is.EqualTo(result));
        }
        public void GetById()
        {
            // Réorganiser
            ValuesController controller = new ValuesController();

            // Agir
            string result = controller.Get(5);

            // Déclarer
            Assert.AreEqual("value", result);
        }
        public void GetById()
        {
            // 準備
            ValuesController controller = new ValuesController();

            // 実行
            string result = controller.Get(5);

            // アサート
            Assert.AreEqual("value", result);
        }
Example #5
0
        public void GetById()
        {
            // Disposizione
            ValuesController controller = new ValuesController();

            // Azione
            string result = controller.Get(5);

            // Asserzione
            Assert.AreEqual("value", result);
        }
        public void GetById()
        {
            // Disponer
            ValuesController controller = new ValuesController();

            // Actuar
            string result = controller.Get(5);

            // Declarar
            Assert.AreEqual("value", result);
        }
        public void GetById()
        {
            // Anordnen
            ValuesController controller = new ValuesController();

            // Aktion ausführen
            string result = controller.Get(5);

            // Bestätigen
            Assert.AreEqual("value", result);
        }
        public void GetById()
        {
            // 排列
            ValuesController controller = new ValuesController();

            // 操作
            string result = controller.Get(5);

            // 断言
            Assert.AreEqual("value", result);
        }
        public void GetById()
        {
            // Упорядочение
            ValuesController controller = new ValuesController();

            // Действие
            string result = controller.Get(5);

            // Утверждение
            Assert.AreEqual("value", result);
        }
        public void Get() {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            IQueryable<string> result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Упорядочение
            ValuesController controller = new ValuesController();

            // Действие
            IEnumerable<string> result = controller.Get();

            // Утверждение
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #12
0
        public void Get()
        {
            // 排列
            ValuesController controller = new ValuesController(new AccountService());

            // 操作
            IEnumerable <string> result = controller.Get();

            // 断言
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            IEnumerable<string> result = controller.Get();

            // Assert
            Assert.That(result, Is.Not.Null);
            Assert.That(2, Is.EqualTo(result.Count()));
            Assert.That("value1", Is.EqualTo(result.ElementAt(0)));
            Assert.That("value2", Is.EqualTo(result.ElementAt(1)));
        }
        public void Get()
        {
            // Anordnen
            ValuesController controller = new ValuesController();

            // Aktion ausführen
            IEnumerable<string> result = controller.Get();

            // Bestätigen
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #15
0
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            IEnumerable <string> result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #16
0
        public void Get()
        {
            // Disponer
            ValuesController controller = new ValuesController();

            // Actuar
            IEnumerable <string> result = controller.Get();

            // Declarar
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Réorganiser
            ValuesController controller = new ValuesController();

            // Agir
            IEnumerable <string> result = controller.Get();

            // Déclarer
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Упорядочение
            ValuesController controller = new ValuesController();

            // Действие
            IEnumerable <string> result = controller.Get();

            // Утверждение
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            RecommendedItem[] result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("12", result.ElementAt(0).Price);
            //Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // 準備
            ValuesController controller = new ValuesController();

            // 実行
            IEnumerable<string> result = controller.Get();

            // アサート
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #21
0
        public void Get()
        {
            // 排列
            var controller = new ValuesController();

            // 作用
            var result = controller.Get();

            // 判斷提示
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Réorganiser
            ValuesController controller = new ValuesController();

            // Agir
            IEnumerable<string> result = controller.Get();

            // Déclarer
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #23
0
        public void Get()
        {
            // Disposizione
            ValuesController controller = new ValuesController();

            // Azione
            IEnumerable<string> result = controller.Get();

            // Asserzione
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
        public void Get()
        {
            // Arrange
            var controller = new ValuesController();

            // Act
            var result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("Mike", result.ElementAt(0).Name);
            Assert.AreEqual("Smith", result.ElementAt(1).Name);
        }
Example #25
0
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            HttpResponseMessage result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            //Assert.AreEqual(2, result.Count());
            //Assert.AreEqual("value1", result.ElementAt(0));
            //Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #26
0
        public void Get()
        {
            // 排列
            ValuesController controller = new ValuesController();

            // 操作
            IEnumerable<string> result = controller.Get();

            // 断言
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("参数值1", result.ElementAt(0));
            Assert.AreEqual("参数值2", result.ElementAt(1));
        }
Example #27
0
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController(_mockSampleLogic.Object);

            // Act
            IEnumerable <string> result = controller.Get();

            // Assert
            _mockSampleLogic.Verify(sl => sl.AddMessage(1, 2), Times.Once);
            _mockSampleLogic.Verify(sl => sl.SubtractMessage(5, 3), Times.Once);
            _mockSampleLogic.Verify(sl => sl.MultiplyMessage(99, 99), Times.Once);
            _mockSampleLogic.Verify(sl => sl.DivideMessage(100, 10), Times.Once);
            Assert.NotNull(result);
        }
        public void GetAParagraph()
        {
            // Arrange
            ValuesController controller = new ValuesController();
            const string testInput = "This is a paragraph.";

            // Act
            string result = controller.Get(testInput);

            // Assert
            const string expectedOutput = "<p>This is a paragraph.</p>";

            Assert.IsNotNull(result);
            Assert.AreEqual(expectedOutput, result);
        }
        public void GetAHeading()
        {
            // Arrange
            ValuesController controller = new ValuesController();
            const string testInput = "This is a heading.\nOh that is a heading.";

            // Act
            string result = controller.Get(testInput);

            // Assert
            const string expectedOutput = "<h6>This is a heading.</h6>";

            Assert.IsNotNull(result);
            Assert.AreEqual(expectedOutput, result);
        }
Example #30
0
        public async Task GetMethodTestTask()
        {
            using (StreamWriter w = File.AppendText("log.txt"))
            {
                Log("getTest", w);
            }
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            var result = controller.Get();

            // Assert
            Assert.IsType <RedirectResult>(result);
        }
Example #31
0
        public void GetEmployees_Success()
        {
            ValuesController controller = new ValuesController(_repo.Object);

            _repo.Setup(a => a.GetEmployees()).Returns(new System.Collections.Generic.List <Models.Employee>
            {
                new Models.Employee {
                    Name = "Ajay", Salary = 10000
                }
            });
            var result = (OkObjectResult)controller.Get();

            Assert.AreEqual(200, result.StatusCode);
            Assert.IsNotNull(result.Value);
        }
Example #32
0
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            string latitude  = "-31.940496";
            string longitude = "115.802877";
            var    result    = controller.Get(latitude, longitude);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result);
        }
        public void Get()
        {
            // Organizar
            ValuesController controller = new ValuesController();
            int id = 1;

            // Agir
            ServiceHttpResult result = controller.Get(id);

            // Declarar
            Assert.IsNotNull(result);
            Assert.AreEqual(result.ServiceResponse.StatusCode, HttpStatusCode.OK);
            Assert.IsNotNull(result.ServiceResponse.Data);
            Assert.AreEqual(id, ((Values)result.ServiceResponse.Data).Id);
        }
Example #34
0
        public void Get_WhenNoParamsArePassed_ShouldAllValues()
        {
            // Arrange
            var controller = new ValuesController();

            // Act
            var response = controller.Get() as ObjectResult;

            // Assert
            response.Should().NotBeNull();
            response.Should().BeOfType <OkObjectResult>();
            response.StatusCode.Should().Be((int)HttpStatusCode.OK);
            response.Value.Should().BeOfType <string[]>();
            response.Value.Should().BeEquivalentTo(new string[] { "value1", "value2" });
        }
Example #35
0
        public void Get_WhenParamIsPassed_ShouldReturnValue(int id, string exptectedValue)
        {
            // Arrange
            var controller = new ValuesController();

            // Act
            var response = controller.Get(id) as ObjectResult;

            // Assert
            response.Should().NotBeNull();
            response.Should().BeOfType <OkObjectResult>();
            response.Value.Should().NotBeNull();
            response.Value.Should().BeOfType <string>();
            response.Value.Should().Be(exptectedValue);
        }
Example #36
0
        public void JSonObjectReturnsExpected()
        {
            // Arrange
            int    id          = 7294;
            string arrivalDate = "2016-03-15";

            someOptions.Value.JsonFile = path;
            ValuesController controller = new ValuesController(someOptions);
            //Act
            var result = controller.Get(id, arrivalDate);

            //Assert
            Assert.NotEmpty(result.Value.ToString());
            Assert.Contains("targetDay", result.Value.ToString());
        }
        public void GetByTitle_Negative_ReturnsBadRequest()
        {
            var            Drepo = new Mock <IKeepRepo>();
            List <Student> not   = null;
            string         type  = "notTitle";
            string         text  = "notext";

            Drepo.Setup(d => d.GetNote(text, type)).Returns(not);
            ValuesController valuecontroller = new ValuesController(Drepo.Object);
            var result = valuecontroller.Get(text, type);

            var brokObject = result as BadRequestObjectResult;

            Assert.NotNull(brokObject);
        }
        public void GetByTitle_Negative_ReturnsNotFound()
        {
            var            Drepo = new Mock <IKeepRepo>();
            List <Student> not   = GetMockDatabase();
            string         type  = "Title";
            string         text  = "notitle";

            Drepo.Setup(d => d.GetNote(text, type)).Returns(not.FindAll(n => n.Title == text));
            ValuesController valuecontroller = new ValuesController(Drepo.Object);
            var result = valuecontroller.Get(text, type);

            var nfokObject = result as NotFoundObjectResult;

            Assert.NotNull(nfokObject);
        }
Example #39
0
        public void Get()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            IEnumerable<string> result = controller.Get();

            Debug.WriteLine("Running a cool test");

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count());
            Assert.AreEqual("value1", result.ElementAt(0));
            Assert.AreEqual("value2", result.ElementAt(1));
        }
Example #40
0
        public void ListOf100Fibonacci()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            List <int> result = controller.Get();

            // Assert

            string     rawData  = " 0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,-1323752223,512559680,-811192543,-298632863,-1109825406,-1408458269,1776683621,368225352,2144908973,-1781832971,363076002,-1418756969,-1055680967,1820529360,764848393,-1709589543,-944741150,1640636603,695895453,-1958435240,-1262539787,1073992269,-188547518,885444751,696897233,1582341984,-2015728079,-433386095,1845853122,1412467027,-1036647147,375819880,-660827267,-285007387,-945834654,-1230842041,2118290601,887448560,-1289228135,-401779575,-1691007710,-2092787285,511172301,-1581614984,-1070442683,1642909629,572466946,-2079590721,-1507123775,708252800,-798870975,-90618175,-889489150";
            var        testData = rawData.Split(',').ToList();
            List <int> intList  = testData.ConvertAll(int.Parse);

            CollectionAssert.AreEqual(intList, result);
        }
        public async Task Get()
        {
            ValuesController controller = new ValuesController();

            // Act
            var result = await controller.Get();

            // Assert
            var actionResult = Assert.IsType <OkObjectResult>(result);

            Assert.Equal(200, actionResult.StatusCode);

            var model = Assert.IsAssignableFrom <RequiredStringValueModel[]>(actionResult.Value);

            Assert.Equal(2, model.Length);
        }
Example #42
0
        public void ReturnDatabaseValues()
        {
            var id             = Guid.NewGuid();
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseInMemoryDatabase();
            var ctx = new ServiceContext(optionsBuilder.Options);

            ctx.People.Add(new Person {
                Id = id
            });
            ctx.SaveChanges();
            var ctr = new ValuesController(ctx);

            Assert.Equal(ctr.Get(), new string[] { id.ToString() });
        }
        public void Given_When_Then()
        {
            // Arrange
            var fakeHelper = A.Fake <IFileHelper>();

            A.CallTo(() => fakeHelper.GetData <Contact>(A <string> .Ignored)).Returns(new List <Contact>());

            var value = new ValuesController(fakeHelper);

            // Act
            var result = value.Get("Email");

            //Assert
            A.CallTo(() => fakeHelper.GetData <Contact>(A <string> .Ignored)).MustHaveHappenedOnceExactly();
            Assert.Pass();
        }
Example #44
0
        public void GetPersons()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            List <Person> result    = controller.Get();
            var           firstName = result.FirstOrDefault <Person>().FirstName;
            var           lastName  = result.FirstOrDefault <Person>().LastName;

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(5, result.Count());
            Assert.AreEqual("Sid", firstName);
            Assert.AreEqual("Green", lastName);
        }
Example #45
0
        public void GetPersonBySearch()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act

            List <Person> result    = controller.Get("Walker");
            var           firstName = result.FirstOrDefault <Person>().FirstName;
            var           lastName  = result.FirstOrDefault <Person>().LastName;

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual("Walker", firstName);
            Assert.AreEqual("Aballo", lastName);
        }
Example #46
0
        public async Task Get_All_And_Return_String_Array()
        {
            // Arrange
            const int expected_results = 2;
            var       controller       = new ValuesController();

            // Act
            var result = controller.Get();

            // Assert
            var okResult = Assert.IsType <OkObjectResult>(result);
            var entities = Assert.IsType <string[]>(okResult.Value);

            Assert.NotNull(entities);
            Assert.Equal(expected_results, entities.Count());
        }
        public void GetAllMethodWithResults()
        {
            var valueController = new ValuesController(_objHelloBal.Object);

            List <HelloModel> messages = new List <HelloModel>
            {
                new HelloModel {
                    ID = 1, Message = "Hello World"
                },
                new HelloModel {
                    ID = 2, Message = "Hello Universe"
                },
            };

            valueController.Get();
        }
        public void TestGetMethod()
        {
            // Arrange
            ValuesController controller = new ValuesController();

            // Act
            IEnumerable <string> result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(4, result.Count()); //change here if u made change in api method
            Assert.AreEqual("New York", result.ElementAt(0));
            Assert.AreEqual("Chicago", result.ElementAt(1));
            Assert.AreEqual("Dallas", result.ElementAt(2));
            Assert.AreEqual("Las Vegas", result.ElementAt(3));
        }
Example #49
0
                public void GetAllNotePinned_PositiveTest(){
                    IFunction F = new Function_op();
                    string pin="true";
                    string title="pinned";
            List<Student> dummy = DummyMock();  // Arrange
            
            Mock<IFunction> MockRepository = new Mock<IFunction>(); // Removing Dependency
            MockRepository.Setup(d => d.Get_all_pinned(pin)).Returns(dummy.FindAll(d=>d.Pinned==true));
             ValuesController controller_m = new ValuesController(MockRepository.Object); 

            var dummy1 = controller_m.Get(pin,title);
             // dummy1 = ModelFromActionResult<SomeViewModelClass>(dummy1);
             var objresult = dummy1 as OkObjectResult;
            Assert.NotNull(objresult);
             var model = objresult.Value as List<Student>;
            Assert.Equal(1 , model.Count);
        }
        public void GetAll_Negative_EmptyList()
        {
            var            Drepo = new Mock <IKeepRepo>();
            List <Student> not   = new List <Student>();

            Drepo.Setup(d => d.GetAllNotes()).Returns(not);
            ValuesController valuecontroller = new ValuesController(Drepo.Object);
            var result   = valuecontroller.Get();
            var okObject = result as OkObjectResult;

            Assert.NotNull(okObject);
            var model = okObject.Value as List <Student>;

            Assert.NotNull(model);

            Assert.Equal(not.Count, model.Count);
        }
Example #51
0
        public void IDWrong()
        {
            // Arrange
            int    id          = 7293;
            string arrivalDate = "2016-03-15";

            someOptions.Value.JsonFile = path;
            ValuesController controller = new ValuesController(someOptions);


            //Act
            var result = controller.Get(id, arrivalDate);

            //  var players = JsonConvert.DeserializeObject<ResponseClass>>(result);
            //Assert
            Assert.Equal(expected, result.Value.ToString());
        }
        public void GetARealHeading()
        {
            // Arrange
            ValuesController controller = new ValuesController();
            const string testInput = "This is a heading.\nOh that is really a heading.\nThis is a paragraph.";

            // Act
            string result = controller.Get(testInput);

            // Assert
            const string expectedOutput = "<h5>This is a heading.</h5><p>This is a paragraph.</p>";

            Assert.IsNotNull(result);
            Assert.AreEqual(expectedOutput, result);
        }
        public void ValuesController_Behavior_Unchanged_By_Tracing(ITestTraceWriter traceWriter)
        {
            HttpConfiguration config = new HttpConfiguration();
            config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional });

            // The null trace writer case is tested as well to verify the
            // ValuesController works as expected without tracing.
            if (traceWriter != null)
            {
                config.Services.Replace(typeof(ITraceWriter), traceWriter);
                traceWriter.Start();
            }

            ValuesController valuesController = new ValuesController();

            using (HttpServer server = new HttpServer(config))
            {
                using (HttpClient client = new HttpClient(server))
                {
                    if (traceWriter != null)
                    {
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Get()
                    string uri = _baseAddress + "/api/Values";
                    HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, uri);
                    HttpResponseMessage response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                    string[] expectedGetResponse = valuesController.Get().ToArray();
                    string[] actualGetResponse = response.Content.ReadAsAsync<string[]>().Result;
                    Assert.Equal(expectedGetResponse, actualGetResponse);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Get(id) using query string
                    uri = _baseAddress + "/api/Values?id=5";
                    request = new HttpRequestMessage(HttpMethod.Get, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                    string expectedGetQueryStringResponse = valuesController.Get(5);
                    string actualGetQueryStringResponse = response.Content.ReadAsAsync<string>().Result;
                    Assert.Equal(expectedGetQueryStringResponse, actualGetQueryStringResponse);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Get(id) using route
                    uri = _baseAddress + "/api/Values/5";
                    request = new HttpRequestMessage(HttpMethod.Get, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                    string expectedGetRouteResponse = valuesController.Get(5);
                    string actualGetRouteResponse = response.Content.ReadAsAsync<string>().Result;
                    Assert.Equal(expectedGetQueryStringResponse, actualGetRouteResponse);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Get(id) using query string that causes model binding error
                    uri = _baseAddress + "/api/Values?id=x";
                    request = new HttpRequestMessage(HttpMethod.Get, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Post(value) with no parameters
                    uri = _baseAddress + "/api/Values";
                    request = new HttpRequestMessage(HttpMethod.Post, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Post(value) using query string
                    uri = _baseAddress + "/api/Values?value=hello";
                    request = new HttpRequestMessage(HttpMethod.Post, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Put(id, value) using query strings
                    uri = _baseAddress + "/api/Values?id=5&value=hello";
                    request = new HttpRequestMessage(HttpMethod.Put, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Put(id, value) using route + query string
                    uri = _baseAddress + "/api/Values/5?value=hello";
                    request = new HttpRequestMessage(HttpMethod.Put, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Delete(id) using query string
                    uri = _baseAddress + "/api/Values?id=5";
                    request = new HttpRequestMessage(HttpMethod.Delete, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                        traceWriter.Start();
                    }

                    // Calls ValuesController.Delete(id) using route
                    uri = _baseAddress + "/api/Values/5";
                    request = new HttpRequestMessage(HttpMethod.Delete, uri);
                    response = client.SendAsync(request).Result;
                    Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
                    if (traceWriter != null)
                    {
                        traceWriter.Finish();
                        Assert.True(traceWriter.DidReceiveTraceRequests);
                    }
                }
            }
        }