Exemplo n.º 1
0
        public void TryFindIssue_IssueIsInStore_ReturnsTrueWithCorrectIssue()
        {
            using (ShimsContext.Create())
            {
                IFingerprint actualFingerprint   = null;
                IFingerprint expectedFingerprint = new StubIFingerprint
                {
                    EqualsIFingerprint = (f) => { actualFingerprint = f; return(true); },
                };
                Issue actualIssue   = null;
                Issue expectedIssue = new ShimIssue();

                using (IIssueStore store = new OutputFileIssueStore(TestFile, Enumerable.Empty <A11yElement>(), (f, e, s) =>
                {
                    s.Add(expectedFingerprint, expectedIssue);
                }))
                {
                    Assert.IsNull(actualFingerprint);
                    Assert.IsNull(actualIssue);
                    Assert.IsTrue(store.TryFindIssue(expectedFingerprint, out actualIssue));
                    Assert.AreSame(expectedFingerprint, actualFingerprint);
                    Assert.AreSame(expectedIssue, actualIssue);
                }
            }
        }
Exemplo n.º 2
0
 public void TryFindIssue_FingerprintIsNull_ThrowsArgumentNullException()
 {
     using (IIssueStore store = new OutputFileIssueStore(TestFile, Enumerable.Empty <A11yElement>()))
     {
         try
         {
             store.TryFindIssue(null, out Issue issue);
         }
         catch (ArgumentNullException e)
         {
             Assert.AreEqual("fingerprint", e.ParamName);
             throw;
         }
     }
 }