Пример #1
0
        public void ExtensionsWhenExtensionsAreClearedThenNoExtensionIsRegistered()
        {
            var executed  = false;
            var extension = A.Fake <IExtension <string, int> >();

            var testee = new StateContainer <string, int>();

            testee.Extensions.Add(extension);
            testee.Extensions.Clear();

            testee.ForEach(e => executed = true);

            executed
            .Should().BeFalse();
        }
Пример #2
0
        public async Task ExtensionsWhenExtensionsAreClearedThenNoExtensionIsRegistered()
        {
            var executed  = false;
            var extension = A.Fake <IExtensionInternal <string, int> >();

            var testee = new StateContainer <string, int>();

            testee.Extensions.Add(extension);
            testee.Extensions.Clear();

            await testee.ForEach(e =>
            {
                executed = true;
                return(Task.CompletedTask);
            })
            .ConfigureAwait(false);

            executed
            .Should().BeFalse();
        }