public void SetConnectionSettings_InvalidUrlOrKey_ThrowException() { // arrange var service = new FlexiWebService(); // act service.SetConnectionSettings("", ""); }
private static IFlexiWebService ServiceFactory() { var flexiweb = new FlexiWebService(); flexiweb.SetConnectionSettings(baseUrl, dfxKey); string fullPath = System.Reflection.Assembly.GetAssembly(typeof(FlexiWebServiceIntegrationTest)).Location; string uploadDirectoryPath = Path.GetDirectoryName(fullPath); flexiweb.UploadDirectory = uploadDirectoryPath; return flexiweb; }
public void SetConnectionSettings_CallWithValidParams_ReturnExecution(string url, string dfxKey) { // TODO : invalid test because validation function recreate BlowfishCrypt object; var stubCrypt = Substitute.For<ICryptProvider>(); stubCrypt.Decrypt("").Returns("1.0"); var stubRequest = Substitute.For<IRequestProvider>(); stubRequest.SendAsync(url,XHttpMethod.GET).Returns("1.0"); var stubJson = Substitute.For<IJsonProvider>(); var stubConfig = Substitute.For<IFlexiWebConfig>(); stubConfig.VerificationServerString.Returns("1.0"); var flexiDbService = new FlexiWebService(stubCrypt, stubRequest, stubJson, stubConfig); flexiDbService.SetConnectionSettings(url, dfxKey); }
public void SetConnectionSettings_CallWithInvalidParams_ThrowException(string url, string dfxKey, Type expected) { var flexiDbService = new FlexiWebService(); Assert.Throws(expected, () => flexiDbService.SetConnectionSettings(url, dfxKey)); }