public async Task GetsAllTheValues()
        {
            var expectedValues = new[] { "value1", "value2" };

            mockHttp.When("http://localhost/api/v1/values")
            .Respond("application/json", "[\"value1\", \"value2\"]");

            var values = await client.GetAll();

            values.Should().BeEquivalentTo(expectedValues);
        }
Ejemplo n.º 2
0
 private static void PrintData(ValuesClient client, string message)
 {
     Console.WriteLine(message);
     foreach (var item in client.GetAll())
     {
         Console.WriteLine($"{item}");
     }
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var url    = "http://localhost:56685";
            var client = new ValuesClient(url, new System.Net.Http.HttpClient());
            var values = client.GetAll();

            foreach (var val in values)
            {
                Console.WriteLine(val);
            }
        }