Example #1
0
        private void VerifyDecoyStatus(int expectedDecoys, int expectedNoSource, int expectedWrongTransitionCount)
        {
            int numDecoys = -1, numNoSource = -1, numWrongTransitionCount = -1;

            RunUI(() => SkylineWindow.CheckDecoys(SkylineWindow.DocumentUI, out numDecoys, out numNoSource, out numWrongTransitionCount));
            Assert.AreEqual(expectedDecoys, numDecoys);
            Assert.AreEqual(expectedNoSource, numNoSource);
            Assert.AreEqual(expectedWrongTransitionCount, numWrongTransitionCount);

            if (numNoSource > 0 || numWrongTransitionCount > 0)
            {
                RunDlg <MultiButtonMsgDlg>(SkylineWindow.ImportResults, dlg =>
                {
                    Assert.IsTrue(
                        dlg.Message.StartsWith(string.Format(
                                                   Resources.SkylineWindow_ImportResults_The_document_contains_decoys_that_do_not_match_the_targets__Out_of__0__decoys_, numDecoys)));
                    if (numNoSource == 1)
                    {
                        Assert.IsTrue(dlg.Message.Contains(Resources.SkylineWindow_ImportResults_1_decoy_does_not_have_a_matching_target));
                    }
                    else if (numNoSource > 1)
                    {
                        Assert.IsTrue(dlg.Message.Contains(string.Format(
                                                               Resources.SkylineWindow_ImportResults__0__decoys_do_not_have_a_matching_target, numNoSource)));
                    }
                    if (numWrongTransitionCount == 1)
                    {
                        Assert.IsTrue(dlg.Message.Contains(Resources.SkylineWindow_ImportResults_1_decoy_does_not_have_the_same_number_of_transitions_as_its_matching_target));
                    }
                    else if (numWrongTransitionCount > 1)
                    {
                        Assert.IsTrue(dlg.Message.Contains(string.Format(
                                                               Resources.SkylineWindow_ImportResults__0__decoys_do_not_have_the_same_number_of_transitions_as_their_matching_targets, numWrongTransitionCount)));
                    }
                    dlg.BtnCancelClick();
                });
            }
        }