public async Task PVA1()
        {
            string testName = "PVA1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            PValueAdjustmentDatasetBasedInputsModel model = new PValueAdjustmentDatasetBasedInputsModel();

            model.DatasetID     = _factory.SheetNames.Single(x => x.Value == "P-value Adjustment Dataset").Key;
            model.PValues       = "p-value - PVA1";
            model.DatasetLabels = "Comparison - PVA1";
            model.SelectedTest  = "Hochberg";
            model.Significance  = "0.05";

            //Act
            StatsOutput statsOutput = await Helpers.SubmitAnalysis(client, "PValueAdjustmentDatasetBasedInputs", new FormUrlEncodedContent(model.ToKeyValue()));

            Helpers.SaveTestOutput("PValueAdjustmentDatasetBasedInputs", model, testName, statsOutput);

            //Assert
            string expectedHtml = File.ReadAllText(Path.Combine("ExpectedResults", "PValueAdjustmentDatasetBasedInputs", testName + ".html"));

            Assert.Equal(Helpers.FixForUnixOSs(expectedHtml), Helpers.FixForUnixOSs(statsOutput.HtmlResults));
        }
Beispiel #2
0
        public async Task CHI1()
        {
            string testName = "CHI1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            ChiSquaredAndFishersExactTestModel model = new ChiSquaredAndFishersExactTestModel();

            model.DatasetID          = _factory.SheetNames.Single(x => x.Value == "Chi-sq and Fishers Exact").Key;
            model.Response           = "Count_1";
            model.GroupingFactor     = "TreatmentG";
            model.ResponseCategories = "TreatmentH";
            model.ChiSquaredTest     = true;
            model.FishersExactTest   = true;
            model.BarnardsTest       = true;
            model.Hypothesis         = "Two-sided";

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/ChiSquaredAndFishersExactTest", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("The Response (Count_1) contains non-numeric data that cannot be processed. Please check the input data and make sure the data was entered correctly.", errors);
            Helpers.SaveOutput("ChiSquaredAndFishersExactTest", testName, errors);
        }
Beispiel #3
0
        public async Task MVA1()
        {
            string testName = "MVA1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            MultivariateAnalysisModel model = new MultivariateAnalysisModel();

            model.DatasetID    = _factory.SheetNames.Single(x => x.Value == "Multivariate").Key;
            model.Responses    = new string[] { "Sepal length" };
            model.AnalysisType = MultivariateAnalysisModel.AnalysisOption.PrincipalComponentsAnalysis;

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/MultivariateAnalysis", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("Responses requires at least two entries.", errors);
            Helpers.SaveOutput("MultivariateAnalysis", testName, errors);
        }
Beispiel #4
0
        public async Task PSS4()
        {
            string testName = "PSS4";

            //Arrange
            HttpClient client = _factory.CreateClient();

            ComparisonOfMeansPowerAnalysisUserBasedInputsModel model = new ComparisonOfMeansPowerAnalysisUserBasedInputsModel();

            model.GroupMean         = 10;
            model.DeviationType     = DeviationType.Variance;
            model.Variance          = 4;
            model.Significance      = "0.05";
            model.AbsoluteChange    = "0.5,1,2,,4";
            model.ChangeType        = ChangeTypeOption.Absolute;
            model.PlottingRangeType = PlottingRangeTypeOption.Power;

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/ComparisonOfMeansPowerAnalysisUserBasedInputs", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("The list of absolute changes contains missing values, please remove any blank entries between the comma separated values.", errors);
            Helpers.SaveOutput("ComparisonOfMeansPowerAnalysisUserBasedInputs", 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);
        }
Beispiel #6
0
        public async Task SS1()
        {
            string testName = "SS1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            SummaryStatisticsModel model = new SummaryStatisticsModel();

            model.DatasetID = _factory.SheetNames.Single(x => x.Value == "Summary Statistics").Key;
            model.Responses = new string[] { "Resp1" };

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/SummaryStatistics", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("The Response (Resp1) contains non-numeric data that cannot be processed. Please check the data and make sure it was entered correctly.", errors);
            Helpers.SaveOutput("SummaryStatistics", testName, errors);
        }
Beispiel #7
0
        public async Task PVA1()
        {
            string testName = "PVA1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            PValueAdjustmentUserBasedInputsModel model = new PValueAdjustmentUserBasedInputsModel();

            model.PValues      = "0.01d";
            model.SelectedTest = "Holm";

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/PValueAdjustmentUserBasedInputs", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("P values contains non-numeric values detected or values are not comma separated.", errors);
            Helpers.SaveOutput("PValueAdjustmentUserBasedInputs", testName, errors);
        }
Beispiel #8
0
        public async Task PSS1()
        {
            string testName = "PSS1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            ComparisonOfMeansPowerAnalysisDatasetBasedInputsModel model = new ComparisonOfMeansPowerAnalysisDatasetBasedInputsModel();

            model.DatasetID         = _factory.SheetNames.Single(x => x.Value == "Power - Means Comp").Key;
            model.Response          = "Resp 1";
            model.Treatment         = "Resp 1";
            model.ControlGroup      = "0.998758912";
            model.PercentChange     = "10";
            model.ChangeType        = ChangeTypeOption.Percent;
            model.PlottingRangeType = PlottingRangeTypeOption.SampleSize;

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/ComparisonOfMeansPowerAnalysisDatasetBasedInputs", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("Response (Resp 1) has been selected in more than one input category, please change your input options.", errors);
            Helpers.SaveOutput("ComparisonOfMeansPowerAnalysisDatasetBasedInputs", testName, errors);
        }
Beispiel #9
0
        public async Task PSS1()
        {
            string testName = "PSS1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            OneWayANOVAPowerAnalysisUserBasedInputsModel model = new OneWayANOVAPowerAnalysisUserBasedInputsModel();

            model.Means = "2,2,x";
            model.VariabilityEstimate = VariabilityEstimate.Variance;
            model.Variance            = 2;

            model.PlottingRangeType = PlottingRangeTypeOption.Power;

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/OneWayANOVAPowerAnalysisUserBasedInputs", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("Means has non-numeric values or the values are not comma separated.", errors);
            Helpers.SaveOutput("OneWayANOVAPowerAnalysisUserBasedInputs", testName, errors);
        }
        public async Task UPTT1()
        {
            string testName = "UPTT1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            UnpairedTTestAnalysisModel model = new UnpairedTTestAnalysisModel();

            model.DatasetID = _factory.SheetNames.Single(x => x.Value == "Unpaired t-test").Key;
            model.Response  = "Resp 1";
            model.Treatment = null;
            model.NormalProbabilityPlotSelected    = true;
            model.ResidualsVsPredictedPlotSelected = true;

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/UnpairedTTestAnalysis", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("The Treatment factor field is required.", errors);
            Helpers.SaveOutput("UnpairedTTestAnalysis", testName, errors);
        }
        public async Task SMA1()
        {
            string testName = "SMA1";

            //Arrange
            HttpClient client = _factory.CreateClient();

            OneWayANOVAPowerAnalysisDatasetBasedInputsModel model = new OneWayANOVAPowerAnalysisDatasetBasedInputsModel();

            model.DatasetID    = _factory.SheetNames.Single(x => x.Value == "Power - One-way ANOVA").Key;
            model.Response     = "Resp1";
            model.Treatment    = "Resp1";
            model.Significance = "0.05";

            //Act
            HttpResponseMessage response = await client.PostAsync("Analyses/OneWayANOVAPowerAnalysisDatasetBasedInputs", new FormUrlEncodedContent(model.ToKeyValue()));

            IEnumerable <string> errors = await Helpers.ExtractErrors(response);

            //Assert
            Assert.Contains("Response (Resp1) has been selected in more than one input category, please change your input options.", errors);
            Helpers.SaveOutput("OneWayANOVAPowerAnalysisDatasetBasedInputs", testName, errors);
        }