コード例 #1
0
        public async void ShouldAddAndSaveTheIdentityResourceInTheContext()
        {
            var identityResource           = new Models.IdentityResource();
            var context                    = A.Fake <IConfigurationDbContext>();
            var identityResourceRepository = new IdentityResourceRepository(context);

            await identityResourceRepository.AddAsync(identityResource);

            A.CallTo(() => context.SaveChangesAsync())
            .MustHaveHappened();

            A.CallTo(() => context.IdentityResources.AddAsync(
                         A <Entities.IdentityResource> .Ignored,
                         A <CancellationToken> .Ignored))
            .MustHaveHappened();
        }