Beispiel #1
0
        public async Task Returns_null_if_no_provider_is_set()
        {
            var provider = new HotSwapAvatarProvider();
            var image    = await provider.GetAvatarAsync(_email, _name, 16);

            Assert.Null(image);
        }
Beispiel #2
0
        public async Task Returns_the_same_image_as_the_wrapped_provider()
        {
            var provider = new HotSwapAvatarProvider();
            var inner    = Substitute.For <IAvatarProvider>();

            provider.Provider = inner;

            inner.GetAvatarAsync(_email, _name, _size).Returns(_img);

            var result = await provider.GetAvatarAsync(_email, _name, _size);

            Assert.AreSame(_img, result);
        }