Esempio n. 1
0
        public void ThrowAPostNotFoundExceptionIfTheIdIsNotFound()
        {
            var id              = Guid.Parse("2C662C69-4A58-4DA8-9B9F-3F417841D6BF");
            var container       = (null as IServiceCollection).Create();
            var serviceProvider = container.BuildServiceProvider();
            var target          = new CachingProvider(serviceProvider);

            Assert.Throws <PostNotFoundException>(() => target.GetUrlByPostId(id));
        }
Esempio n. 2
0
        public void ReturnTheCorrectUrlBasedOnThePostId(string idString, string url)
        {
            var id              = Guid.Parse(idString);
            var container       = (null as IServiceCollection).Create();
            var serviceProvider = container.BuildServiceProvider();
            var target          = new CachingProvider(serviceProvider);
            var actual          = target.GetUrlByPostId(id);

            Assert.Equal(url, actual);
        }