Exemple #1
0
        public async Task EventPublisherRepository_GetApplicationAsync_ReturnsNullWhenNotFound()
        {
            // arrange
            EventPublisherContext context = GetContext();
            var target = new EventPublisherRepository(context);

            // act
            Application result = await target.GetApplicationAsync(1);

            // assert
            Assert.Null(result);
        }
Exemple #2
0
        public async Task EventPublisherRepository_GetApplicationAsync_ReturnsApplicationWhenFound()
        {
            // arrange
            EventPublisherContext context = GetContext();
            var applicationId             = context.Applications.Add(new ApplicationEntity
            {
            }).Entity.ApplicationId;
            await context.SaveChangesAsync().ConfigureAwait(false);

            var target = new EventPublisherRepository(context);

            // act
            Application result = await target.GetApplicationAsync(applicationId);

            // assert
            Assert.NotNull(result);
        }