public async Task AddNewBlogTests() { //Arrange var mapperConfig = new MapperConfiguration(x => x.AddProfile(new MappingProfile())); var mapper = mapperConfig.CreateMapper(); var blogService = new BlogService(this.context, mapper); var expectedResult = new BlogAddNewBingingModel { Author = "Some Author", Content = "Some Content", ImageUrl = "Some Url", SubTitle = "Some Subtitle", Title = "Some Title" }; //Act await blogService.AddNewBlog(expectedResult); //Assert Assert.Equal(1, this.context.Blogs.Count()); }