public async Task OSTT4() { string testName = "OSTT4"; //Arrange HttpClient client = _factory.CreateClient(); OneSampleTTestAnalysisModel model = new OneSampleTTestAnalysisModel(); model.DatasetID = _factory.SheetNames.Single(x => x.Value == "One Sample t-test").Key; model.Responses = new string[] { "Resp 9" }; model.ResponseTransformation = "Log10"; model.TargetValue = 0.1m; //Act HttpResponseMessage response = await client.PostAsync("Analyses/OneSampleTTestAnalysis", new FormUrlEncodedContent(model.ToKeyValue())); IEnumerable <string> warnings = await Helpers.ExtractWarnings(response); //Assert Assert.Contains("You have Log10 transformed the Resp 9 variable. Unfortunately some of the Resp 9 values are zero and/or negative. These values have been ignored in the analysis as it is not possible to transform them.", warnings); Helpers.SaveOutput("OneSampleTTestAnalysis", testName, warnings); }
public async Task OSTT17() { string testName = "OSTT17"; //Arrange HttpClient client = _factory.CreateClient(); OneSampleTTestAnalysisModel model = new OneSampleTTestAnalysisModel(); model.DatasetID = _factory.SheetNames.Single(x => x.Value == "One Sample t-test").Key; model.Responses = new string[] { "Resp 1", "Resp2", "Resp 3", "Resp4" }; model.ResponseTransformation = "None"; model.Significance = "0.05"; model.TargetValue = 1m; //Act StatsOutput statsOutput = await Helpers.SubmitAnalysis(client, "OneSampleTTestAnalysis", new FormUrlEncodedContent(model.ToKeyValue())); Helpers.SaveTestOutput("OneSampleTTestAnalysis", model, testName, statsOutput); //Assert string expectedHtml = File.ReadAllText(Path.Combine("ExpectedResults", "OneSampleTTestAnalysis", testName + ".html")); Assert.Equal(Helpers.FixForUnixOSs(expectedHtml), Helpers.FixForUnixOSs(statsOutput.HtmlResults)); }
public async Task OSTT2() { string testName = "OSTT2"; //Arrange HttpClient client = _factory.CreateClient(); OneSampleTTestAnalysisModel model = new OneSampleTTestAnalysisModel(); model.DatasetID = _factory.SheetNames.Single(x => x.Value == "One Sample t-test").Key; model.Responses = new string[] { "Resp 6" }; model.TargetValue = 0.1m; //Act HttpResponseMessage response = await client.PostAsync("Analyses/OneSampleTTestAnalysis", new FormUrlEncodedContent(model.ToKeyValue())); IEnumerable <string> errors = await Helpers.ExtractErrors(response); //Assert Assert.Contains("The Response (Resp 6) contains non-numeric data that cannot be processed. Please check the data and make sure it was entered correctly.", errors); Helpers.SaveOutput("OneSampleTTestAnalysis", testName, errors); }
public async Task OSTT1() { string testName = "OSTT1"; //Arrange HttpClient client = _factory.CreateClient(); OneSampleTTestAnalysisModel model = new OneSampleTTestAnalysisModel(); model.DatasetID = _factory.SheetNames.Single(x => x.Value == "One Sample t-test").Key; model.Responses = new string[] { "Resp 5" }; model.TargetValue = 0.1m; //Act HttpResponseMessage response = await client.PostAsync("Analyses/OneSampleTTestAnalysis", new FormUrlEncodedContent(model.ToKeyValue())); IEnumerable <string> errors = await Helpers.ExtractErrors(response); //Assert Assert.Contains("There is no replication in the response variable (Resp 5). Please select another factor.", errors); Helpers.SaveOutput("OneSampleTTestAnalysis", testName, errors); }