-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
andrew-cat
committed
Oct 8, 2020
1 parent
2000189
commit 2630454
Showing
39 changed files
with
1,774 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ notifications: | |
to: | ||
- [email protected] | ||
on_build_success: false | ||
on_build_failure: true | ||
on_build_failure: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Moq; | ||
using Moq.Protected; | ||
|
||
namespace ConfigCat.Client.Tests | ||
{ | ||
[TestClass] | ||
public class DataGovernanceTests | ||
{ | ||
Uri GlobalUri = new Uri(ConfigurationBase.BaseUrlGlobal); | ||
|
||
[TestMethod] | ||
public async Task WithDefaultDataGovernanceSetting_ShouldUseGlobalCdnEveryRequests() | ||
{ | ||
var configuration = new AutoPollConfiguration | ||
{ | ||
SdkKey = "DEMO" | ||
}; | ||
|
||
var handlerMock = new Mock<HttpClientHandler>(MockBehavior.Strict); | ||
handlerMock | ||
.Protected() | ||
.Setup<Task<HttpResponseMessage>>( | ||
"SendAsync", | ||
ItExpr.IsAny<HttpRequestMessage>(), | ||
ItExpr.IsAny<CancellationToken>() | ||
) | ||
|
||
.ReturnsAsync(new HttpResponseMessage() | ||
{ | ||
StatusCode = HttpStatusCode.OK, | ||
Content = new StringContent("{\"p\": {\"u\": \"http://example.com\", \"r\": 0}}"), | ||
}) | ||
.Verifiable(); | ||
|
||
IConfigFetcher fetcher = new HttpConfigFetcher(configuration.CreateUri(), "DEMO", Mock.Of<ILogger>(), handlerMock.Object, configuration.IsCustomBaseUrl); | ||
|
||
// Act | ||
|
||
await fetcher.Fetch(ProjectConfig.Empty); | ||
|
||
// Assert | ||
|
||
handlerMock.VerifyAll(); | ||
// TODO invoke count + URL check | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"f" : { | ||
"numberWithPercentage": { | ||
"v": "Default", | ||
"t": 1, | ||
"p": [ | ||
{ | ||
"o": 0, | ||
"v": "80%", | ||
"p": 80 | ||
}, | ||
{ | ||
"o": 1, | ||
"v": "20%", | ||
"p": 20 | ||
} | ||
], | ||
"r": [ | ||
{ | ||
"o": 0, | ||
"a": "Custom1", | ||
"t": 10, | ||
"c": "sajt", | ||
"v": "=sajt" | ||
}, | ||
{ | ||
"o": 1, | ||
"a": "Custom1", | ||
"t": 12, | ||
"c": "2.1", | ||
"v": "<2.1" | ||
}, | ||
{ | ||
"o": 2, | ||
"a": "Custom1", | ||
"t": 13, | ||
"c": "2,1", | ||
"v": "<=2,1" | ||
}, | ||
{ | ||
"o": 3, | ||
"a": "Custom1", | ||
"t": 10, | ||
"c": "3.5", | ||
"v": "=3.5" | ||
}, | ||
{ | ||
"o": 4, | ||
"a": "Custom1", | ||
"t": 14, | ||
"c": "5", | ||
"v": ">5" | ||
}, | ||
{ | ||
"o": 5, | ||
"a": "Custom1", | ||
"t": 15, | ||
"c": "5", | ||
"v": ">=5" | ||
}, | ||
{ | ||
"o": 6, | ||
"a": "Custom1", | ||
"t": 11, | ||
"c": "4.2", | ||
"v": "<>4.2" | ||
} | ||
] | ||
}, | ||
"number": { | ||
"v": "Default", | ||
"t": 1, | ||
"p": [], | ||
"r": [ | ||
{ | ||
"o": 0, | ||
"a": "Custom1", | ||
"t": 11, | ||
"c": "5", | ||
"v": "<>5" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.