コード例 #1
0
        public void ShouldBeNotAbleToFindElementByIdWhenComparerIsSubClassOfStringComparer()
        {
            // GIVEN
            var endsWithComparer = new EndsWithComparer("myId");
            var byID             = Find.ById(endsWithComparer);

            // WHEN
            var hinter = IdHinter.GetIdHint(byID);

            // THEN
            Assert.That(hinter, Is.Null);
        }
コード例 #2
0
        public void ShouldBeAbleToFindElementByIdWhenComparerIsStringComparer()
        {
            // GIVEN
            var byID = Find.ById("myId");

            Assert.That(byID.Comparer.GetType(), Is.EqualTo(typeof(Comparers.StringComparer)), "pre-condition failed");

            // WHEN
            var hinter = IdHinter.GetIdHint(byID);

            // THEN
            Assert.That(hinter, Is.EqualTo("myId"));
        }