public ContentPagesDetectionTests() { _app = new VueTestApp(); _response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { _response = client.DownloadStringWithSession(_app.BaseUrl + "/app.js"); } } catch (Exception ex) { _logger.LogError(ex, nameof(ContentPagesDetectionTests)); } }
public void ShouldContainEmbeddedResourceContent(string content) { var response = string.Empty; var message = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadString(_app.BaseUrl + "/" + content); } } catch (Exception ex) { message = ex.Message; } Assert.True(response != null, message); }
public void StartJsShouldContainStartUserScript() { var response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app.BaseUrl + "/start.js"); } } catch (Exception ex) { _logger.LogError(ex, nameof(StartJsShouldContainStartUserScript)); } Assert.NotNull(response); Assert.Contains("'start_user_InitialLoaded'", response); }
public void IndexShouldContainUserScriptsRef() { var response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadString(_app.BaseUrl); } } catch (Exception ex) { _logger.LogError(ex, nameof(IndexShouldContainUserScriptsRef)); } Assert.NotNull(response); Assert.Contains("'scripts/userscripts.js'", response); }
public void DefaultAppShouldContainPagesFromCurrentAssemblyOnly() { var response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app.BaseUrl + "/app.js"); } } catch (Exception ex) { _logger.LogError(ex, nameof(DefaultAppShouldContainPagesFromCurrentAssemblyOnly)); } Assert.NotNull(response); Assert.Contains("'start'", response); Assert.DoesNotContain("'secondapp'", response); }
public void OnLoadShouldBeCalledForStartVmAfterFirstCall() { var response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app.BaseUrl + "/ViewModel/StartVm"); } } catch (Exception ex) { _logger.LogError(ex, nameof(OnLoadShouldBeCalledForStartVmAfterFirstCall)); } Assert.NotNull(response); Assert.Equal(1, _app.Data.StartVmOnLoadCalled); Assert.Single(_app.Data.StartVmParameters); }
public void RequestWithParametersShouldSetSessionParameters() { var response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app.BaseUrl + "/ViewModel/StartVm?test=1234"); } } catch (Exception ex) { _logger.LogError(ex, nameof(RequestWithParametersShouldSetSessionParameters)); } Assert.NotNull(response); Assert.True(_app.Data.StartVmParameters.ContainsKey("test")); Assert.Equal("1234", _app.Data.StartVmParameters["test"]); }
public void RunningMultipleAppsShouldNotMixUpContent() { var response = string.Empty; // app1 try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app1.BaseUrl + "/app.js"); } } catch (Exception ex) { _logger.LogError(ex, nameof(RunningMultipleAppsShouldNotMixUpContent)); } Assert.NotNull(response); Assert.Contains("'start'", response); Assert.DoesNotContain("'secondapp'", response); // app2 try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app2.BaseUrl + "/app.js"); } } catch (Exception ex) { _logger.LogError(ex, nameof(RunningMultipleAppsShouldNotMixUpContent)); } Assert.NotNull(response); Assert.Contains("'secondapp'", response); Assert.DoesNotContain("'start'", response); }
public void AppWithPrivateIndexShouldGetPrivateIndex() { var response = string.Empty; // app2 - with private index.html try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app2.BaseUrl); } } catch (Exception ex) { _logger.LogError(ex, nameof(AppWithPrivateIndexShouldGetPrivateIndex)); } Assert.NotNull(response); Assert.Contains("<!--IctBaden.Stonehenge3.Vue.TestApp2.index.html-->", response); Assert.DoesNotContain("<!--IctBaden.Stonehenge3.Vue.index.html-->", response); }
public void ModifyNotifyPropertyShouldCreateEvent() { var response = string.Empty; try { // ReSharper disable once ConvertToUsingDeclaration using (var client = new RedirectableHttpClient()) { response = client.DownloadStringWithSession(_app.BaseUrl + "/ViewModel/StartVm"); } } catch (Exception ex) { _logger.LogError(ex, nameof(ModifyNotifyPropertyShouldCreateEvent)); } Assert.NotNull(response); _app.Data.ExecAction("Notify"); // rising event not yet tested ... }