コード例 #1
0
        public void RefreshHintsTest3()
        {
            // Arrange
            var objectUnderTest = new ExerciseImportHelper();
            var ex3             = new Exercise
            {
                ExerciseCode = "STAB_012_X",
                Name         = "Standing weight shift",
                EasierHint   = "Don't move",
                HarderHint   = "Close your eyes"
            };
            var hint1 = new ExerciseHint()
            {
                Id         = ex3.Id,
                Text       = "\"Look at a spot on the wall, but not too hard!\"",
                ExerciseID = ex3.Id
            };
            ICollection <ExerciseHint> hints = new HashSet <ExerciseHint>
            {
                hint1
            };
            var importer = new ExerciseImportHelper();
            var line     = importer.SplitCSVLine(CSVInputex3);

            // Act
            importer.RefreshHints(ex3, line);
            //Assert
            ex3.ExerciseHints.Equals(hints);
        }
コード例 #2
0
        public void FindTheNumberOfHintsinHeader(string header, int expectedHintCount)
        {
            //Arrange

            var importer = new ExerciseImportHelper();
            var csvArray = importer.SplitCSVLine(header);
            //Act
            var result = importer.FindNumHints(csvArray);

            //Assert
            result.Should().Be(expectedHintCount);
        }
コード例 #3
0
        public void SplitLineIntoArray(string input, string[] expected)
        {
            // Arrange
            var sut = new ExerciseImportHelper();
            // Act
            var result = sut.SplitCSVLine(input);

            // Assert
            for (int i = 0; i < expected.Length; i++)
            {
                result[i].Should().Be(expected[i]);
            }
        }
コード例 #4
0
        public void RefreshHintsTest2()
        {
            // Arrange
            var objectUnderTest = new ExerciseImportHelper();
            var ex2             = new Exercise
            {
                ExerciseCode = "FLX_003_R",
                Name         = "Old Calf stretch Right",
                EasierHint   = "Easy, Partner",
                HarderHint   = "As a diamond."
            };
            var hint1 = new ExerciseHint()
            {
                Id         = ex2.Id,
                Text       = "Knees Straight",
                ExerciseID = ex2.Id
            };
            var hint2 = new ExerciseHint()
            {
                Id         = ex2.Id,
                Text       = "Heels on the floor",
                ExerciseID = ex2.Id
            };
            var hint3 = new ExerciseHint()
            {
                Id         = ex2.Id,
                Text       = "Lean forward!",
                ExerciseID = ex2.Id
            };
            ICollection <ExerciseHint> hints = new HashSet <ExerciseHint>
            {
                hint1,
                hint2,
                hint3
            };
            var importer = new ExerciseImportHelper();
            var line     = importer.SplitCSVLine(CSVInputex2);

            // Act
            importer.RefreshHints(ex2, line);
            //Assert
            ex2.ExerciseHints.Equals(hints);
        }
コード例 #5
0
        public void RefreshHintsTest4()
        {
            // Arrange
            var objectUnderTest = new ExerciseImportHelper();
            var ex4             = new Exercise
            {
                ExerciseCode = "KSA_999_X",
                Name         = "One Finger pull-up",
                EasierHint   = "Use two fingers",
                HarderHint   = "Pinky Finger"
            };

            ICollection <ExerciseHint> hints = new HashSet <ExerciseHint>();
            var importer = new ExerciseImportHelper();
            var line     = importer.SplitCSVLine(CSVInputex4);

            // Act
            importer.RefreshHints(ex4, line);
            //Assert
            ex4.ExerciseHints.Equals(hints);
        }
コード例 #6
0
        public void RefreshHintsInExercise()
        {
            // Arrange
            var ex1 = new Exercise
            {
                ExerciseCode = "FLX_003_L",
                Name         = "Old Calf stretch Left",
                EasierHint   = "Easy, Partner",
                HarderHint   = "As a diamond."
            };

            var hint1 = new ExerciseHint()
            {
                Id         = ex1.Id,
                Text       = "Knees Straight",
                ExerciseID = ex1.Id
            };
            var hint2 = new ExerciseHint()
            {
                Id         = ex1.Id,
                Text       = "Heels on the floor",
                ExerciseID = ex1.Id
            };
            ICollection <ExerciseHint> hints = new HashSet <ExerciseHint>
            {
                hint1,
                hint2
            };

            var importer = new ExerciseImportHelper();
            var line     = importer.SplitCSVLine(inputTextWithCommaInHint);

            // Act
            importer.RefreshHints(ex1, line);
            //Assert
            ex1.ExerciseHints.Equals(hints); // TODO: Fix
        }