Exemplo n.º 1
0
        public void GetViewSolution_InfinityCountSolutions_CorrectPartView()
        {
            // arrange
            var paramsEquation = new ParamsEquation(0, 0, 0);
            var s = SolutionEquation.CreateInfinityCountSolutions();

            // act
            var view = paramsEquation.GetViewSolution(s);

            // assert
            Assert.IsTrue(view.Contains(paramsEquation.ToString()));
            Assert.IsTrue(view.Contains("бесконечное число корней"));
        }
Exemplo n.º 2
0
        public void GetViewSolution_NotSolutions_CorrectPartView()
        {
            // arrange
            var paramsEquation = new ParamsEquation(0, 0, 0);
            var s = SolutionEquation.CreateWithoutSolutions();

            // act
            var view = paramsEquation.GetViewSolution(s);

            // assert
            Assert.IsTrue(view.Contains(paramsEquation.ToString()));
            Assert.IsTrue(view.Contains("нет корней"));
        }
Exemplo n.º 3
0
        public void GetViewSolution_OneSolutions_CorrectPartView()
        {
            // arrange
            var x = 1;
            var paramsEquation = new ParamsEquation(0, 0, 0);
            var s = SolutionEquation.CreateSolutions(x);

            // act
            var view = paramsEquation.GetViewSolution(s);

            // assert
            Assert.IsTrue(view.Contains(paramsEquation.ToString()));
            Assert.IsTrue(view.Contains($"один корень: x = {x}"));
        }
Exemplo n.º 4
0
        public void GetViewSolution_TwoSolutions_CorrectPartView()
        {
            // arrange
            var x1             = 1;
            var x2             = 2;
            var paramsEquation = new ParamsEquation(0, 0, 0);
            var s = SolutionEquation.CreateSolutions(x1, x2);

            // act
            var view = paramsEquation.GetViewSolution(s);

            // assert
            Assert.IsTrue(view.Contains(paramsEquation.ToString()));
            Assert.IsTrue(view.Contains($"два корня: x1 = {x1}, x2 = {x2}"));
        }