Exemplo n.º 1
0
        public void Should_call_inner_to_create_value()
        {
            var cacheEntry = new Mock <ICacheEntry>();

            cache.Setup(x => x.CreateEntry("a-key")).Returns(cacheEntry.Object);

            var result = sut.CreateEntry("a-key");

            Assert.Equal(cacheEntry.Object, result);
        }
        public void Should_call_inner_to_create_value()
        {
            var cacheEntry = A.Dummy <ICacheEntry>();

            A.CallTo(() => cache.CreateEntry("a-key"))
            .Returns(cacheEntry);

            var result = sut.CreateEntry("a-key");

            Assert.Equal(cacheEntry, result);
        }