Exemplo n.º 1
0
        public void Distimo_Request_Must_Always_Use_Json()
        {
            // Arrange
            var distimoService = new DistimoService(MockWebRequestService.Object, MockDistimoAuthService.Object);

            // Act
            var request = distimoService.CreateDistimoRequest(SupportedDistimoApis.Revenues, String.Empty);

            // Assert
            Assert.True(request.Address.Query.Contains("format=json"));
        }
Exemplo n.º 2
0
        public void Check_Distimo_Request_Appends_Query_String(string queryString)
        {
            // Arrange
            var distimoService = new DistimoService(MockWebRequestService.Object, MockDistimoAuthService.Object);

            // Act
            var request = distimoService.CreateDistimoRequest(SupportedDistimoApis.Revenues, queryString);

            // Assert
            Assert.True(request.Address.Query.Contains(queryString));
        }
Exemplo n.º 3
0
        public void Confirm_Basic_Authentication_Is_Being_Used()
        {
            // Arrange
            var distimoService = new DistimoService(MockWebRequestService.Object, MockDistimoAuthService.Object);

            // Act
            var request = distimoService.CreateDistimoRequest(SupportedDistimoApis.Revenues, String.Empty);

            // Assert - no point is unit testing the hash beyond this, integration testing will prove if hash
            // algorithm is correct.
            Assert.True(request.Headers["Authorization"].Contains("Basic"));
        }
Exemplo n.º 4
0
        public void Is_Filter_Asset_Revenues_API_Address_As_Expected()
        {
            // Arrange
            var distimoService = new DistimoService(MockWebRequestService.Object, MockDistimoAuthService.Object);
            var distimoBaseAddress = distimoService.DistimoAPIBaseAddress;

            // Act
            var address = distimoService.GetDistimoAPIAddress(SupportedDistimoApis.FilterAssetRevenues);

            // Assert
            Assert.Equal(address, distimoBaseAddress + "filters/assets/revenues");
        }