示例#1
0
        public void SetUp()
        {
            Actor = new Actor();
            Cache = new AnswerCache();

            MockQuestionA = new Mock <ICacheableQuestion <int> >();
            MockQuestionA.Setup(x => x.RequestAs(It.IsAny <IActor>())).Returns(1);
            MockQuestionA.Setup(x => x.GetHashCode()).Returns(1);

            MockQuestionB = new Mock <ICacheableQuestion <int> >();
            MockQuestionB.Setup(x => x.RequestAs(It.IsAny <IActor>())).Returns(2);
            MockQuestionB.Setup(x => x.GetHashCode()).Returns(2);
        }
 /// <summary>
 /// Private constructor.
 /// </summary>
 /// <param name="cache">The answer cache.</param>
 private CacheAnswers(AnswerCache cache) => Cache = cache;