Esempio n. 1
0
        public async Task PSS22()
        {
            string testName = "PSS22";

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

            ComparisonOfMeansPowerAnalysisUserBasedInputsModel model = new ComparisonOfMeansPowerAnalysisUserBasedInputsModel();

            model.GroupMean         = 10;
            model.DeviationType     = DeviationType.Variance;
            model.Variance          = 4;
            model.Significance      = "0.05";
            model.PercentChange     = "10,20,30,40";
            model.ChangeType        = ChangeTypeOption.Percent;
            model.PlottingRangeType = PlottingRangeTypeOption.SampleSize;
            model.SampleSizeFrom    = 4;
            model.SampleSizeTo      = 8;

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

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

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

            Assert.Equal(Helpers.FixForUnixOSs(expectedHtml), Helpers.FixForUnixOSs(statsOutput.HtmlResults));
        }
Esempio n. 2
0
        public async Task PSS5()
        {
            string testName = "PSS5";

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

            ComparisonOfMeansPowerAnalysisUserBasedInputsModel model = new ComparisonOfMeansPowerAnalysisUserBasedInputsModel();

            model.GroupMean         = 10;
            model.DeviationType     = DeviationType.Variance;
            model.Variance          = 4;
            model.Significance      = "0.05";
            model.PercentChange     = "0.5,1,2,,4";
            model.ChangeType        = ChangeTypeOption.Percent;
            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 percent changes contains missing values, please remove any blank entries between the comma separated values.", errors);
            Helpers.SaveOutput("ComparisonOfMeansPowerAnalysisUserBasedInputs", testName, errors);
        }
Esempio n. 3
0
        public async Task PSS12()
        {
            string testName = "PSS12";

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

            ComparisonOfMeansPowerAnalysisUserBasedInputsModel model = new ComparisonOfMeansPowerAnalysisUserBasedInputsModel();

            model.GroupMean         = 10;
            model.DeviationType     = DeviationType.Variance;
            model.Variance          = -2;
            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("Variance must be > 0.", errors);
            Helpers.SaveOutput("ComparisonOfMeansPowerAnalysisUserBasedInputs", testName, errors);
        }
Esempio n. 4
0
        public async Task PSS19()
        {
            string testName = "PSS19";

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

            ComparisonOfMeansPowerAnalysisUserBasedInputsModel model = new ComparisonOfMeansPowerAnalysisUserBasedInputsModel();

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

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

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

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

            Assert.Equal(Helpers.FixForUnixOSs(expectedHtml), Helpers.FixForUnixOSs(statsOutput.HtmlResults));
        }
Esempio n. 5
0
        public async Task PSS7()
        {
            string testName = "PSS7";

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

            ComparisonOfMeansPowerAnalysisUserBasedInputsModel model = new ComparisonOfMeansPowerAnalysisUserBasedInputsModel();

            model.GroupMean         = 10;
            model.DeviationType     = DeviationType.Variance;
            model.Variance          = 4;
            model.Significance      = "0.05";
            model.PercentChange     = "0.5,1,2,4,x (%)";
            model.ChangeType        = ChangeTypeOption.Percent;
            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("Percent changes has non-numeric values or the values are not comma separated.", errors);
            Helpers.SaveOutput("ComparisonOfMeansPowerAnalysisUserBasedInputs", testName, errors);
        }