private void CompareItems(string item1, string item2) { string tempValue1, tempValue2; int tempCompared, tempEqual; IdentificationResults results; tempEqual = 0; tempCompared = 0; foreach (string exp in MyPrescanInfo.Experiments) { if (MySourceInfo.ValidGenotypes.Contains(item1, exp) && MySourceInfo.ValidGenotypes.Contains(item2, exp)) { tempValue1 = MySourceInfo.ValidGenotypes[item1, exp]; tempValue2 = MySourceInfo.ValidGenotypes[item2, exp]; if (IsEqual(tempValue1, tempValue2)) { tempEqual++; } tempCompared++; } } if (tempCompared > 0) { if (((100.0 * (double)tempEqual / (double)tempCompared) >= MySettings.SimilarityCutoffPercent) && (tempCompared >= MySettings.ExperimentsCutoff)) { results = new IdentificationResults(item1, item2, tempEqual, tempCompared); MyResultList.Add(results); } } }
public void Given_Simplified_Resx_File_That_Is_Ok_Expect_True() { var expected = new IdentificationResults { WasMatch = true }; var actual = resxChecker.IsOfType(ChineseType.Simplified, @"C:\Dev\Misc\ChineseIdentifier\ChineseIdentifier.TestHarness\App_GlobalResources\Global.zh-CN.resx"); actual.ShouldBeEquivalentTo(expected); }
public void Given_Simplified_Resx_File_But_Expecting_Traditional_Expect_False_With_Message() { var expected = new IdentificationResults { WasMatch = false, Message = "Mismatch found in file: C:\\Dev\\Misc\\ChineseIdentifier\\ChineseIdentifier.TestHarness\\App_GlobalResources\\Global.zh-CN.resx.\nExpected Traditional, but found issue in resource Content." }; var actual = resxChecker.IsOfType(ChineseType.Traditional, @"C:\Dev\Misc\ChineseIdentifier\ChineseIdentifier.TestHarness\App_GlobalResources\Global.zh-CN.resx"); actual.ShouldBeEquivalentTo(expected); }