Browse Source

Added TotalTags

Piotr Czajkowski 3 years ago
parent
commit
39e1b6ac00
2 changed files with 24 additions and 1 deletions
  1. 9 1
      memoQAnalysis/MemoQAnalysis.cs
  2. 15 0
      memoQAnalysisTests/AnalysisTests.cs

+ 9 - 1
memoQAnalysis/MemoQAnalysis.cs

@@ -295,7 +295,15 @@ namespace memoQAnalysis
         }
 
         [Index(86)]
-        public int TotalTags { get; set; }
+        public int TotalTags {
+            get
+            {
+                var total = XtranslatedTags + HundredOneTags + RepetitionsTags + HundredTags +
+                            NinentyFiveNineTags + EightyFiveNinentyFourTags + SeventyFiveEightyFourTags +
+                            FiftySeventyFourTags + NoMatchTags + FragmentsTags;
+                return total;
+            }
+        }
 
         [Index(87)]
         public int TotalReserved1 { get; set; }

+ 15 - 0
memoQAnalysisTests/AnalysisTests.cs

@@ -114,6 +114,21 @@ namespace memoQAnalysisTests
             Assert.Equal(expectedTotal, newTotal);
         }
 
+        [Fact]
+        public void TotalTags()
+        {
+            var test = new Analysis(MainTestFile);
+            var total = test.Data.Sum(x => x.TotalTags);
+
+            var originalFirstFile = test.Data.FirstOrDefault();
+            Assert.NotNull(originalFirstFile);
+            originalFirstFile.HundredOneTags += 1050;
+
+            var expectedTotal = total + 1050;
+            var newTotal = test.Data.Sum(x => x.TotalTags);
+            Assert.Equal(expectedTotal, newTotal);
+        }
+
         [Fact]
         public void ReadModifySaveCheck()
         {