Example #1
0
        public void GetVersion()
        {
            var client  = new CustomerApiConsumer("http://localhost:8080");
            var version = client.GetVersion();

            Assert.Equal("1.2.3.4", version.Build);
        }
Example #2
0
        public void GetCustomer()
        {
            var client   = new CustomerApiConsumer("http://localhost:8080");
            var customer = client.GetCustomer("tester");

            Assert.Equal("tester", customer.Id);
        }
Example #3
0
        public void GettingCustomerThatExists()
        {
            //Given
            PactDefinitions.GetCustomer.CreateOn(this.mockProviderService);
            var consumer = new CustomerApiConsumer(this.mockProviderServiceBaseUri);

            //When
            var result = consumer.GetCustomer("tester");

            //Then
            Assert.Equal("tester", result.Id);
            this.mockProviderService.VerifyInteractions(); //NOTE: Verifies that interactions registered on the mock provider are called once and only once
        }
Example #4
0
        public void GettingVersion()
        {
            //Given
            PactDefinitions.GetVersion.CreateOn(this.mockProviderService);
            var consumer = new CustomerApiConsumer(this.mockProviderServiceBaseUri);

            //When
            var result = consumer.GetVersion();

            //Then
            Assert.Equal("1.2.3.4", result.Build);
            Assert.Equal("09/17/2015 20:29:13", result.Date.ToString(CultureInfo.InvariantCulture));
            this.mockProviderService.VerifyInteractions(); //NOTE: Verifies that interactions registered on the mock provider are called once and only once
        }
 public void GetVersion()
 {
     var client = new CustomerApiConsumer("http://localhost:8080");
     var version = client.GetVersion();
     Assert.Equal("1.2.3.4", version.Build);
 }
 public void GetCustomer()
 {
     var client = new CustomerApiConsumer("http://localhost:8080");
     var customer = client.GetCustomer("tester");
     Assert.Equal("tester", customer.Id);
 }