public void GenerateSequence_WithCount_ReturnsListOfSameCount() { //Arrange FluentData fluentData = new FluentData(); //Act var sequence = fluentData.GenerateSequence <FluentData.SampleEntity>(5); //Assert Assert.That(sequence.Count(), Is.EqualTo(5)); }
public async Task SaveAsync_WithSequence_StoresInDB() { using (var context = new ApplicationDbContext(inMemoryDatabaseHelper.Options)) { //Arrange FluentData fluentData = new FluentData(context); var sequence = fluentData.GenerateSequence <ApplicationUser>(5); //Act await fluentData.SaveAsync(sequence); } //Assert using (var context = new ApplicationDbContext(inMemoryDatabaseHelper.Options)) { Assert.That(context.Set <ApplicationUser>().Count(), Is.EqualTo(5)); } }
public async Task ReadAll_ReturnsSequence() { var samples = default(IEnumerable <FluentData.SampleEntity>); using (var context = new TestDbContext(options)) { //Arrange var repository = new Repository <FluentData.SampleEntity>(context); var fluentData = new FluentData(context); samples = fluentData.GenerateSequence <FluentData.SampleEntity>(5); await fluentData.SaveAsync(samples); } using (var context = new TestDbContext(options)) { //Act var repository = new Repository <FluentData.SampleEntity>(context); var sequence = repository.ReadAll(); //Assert Assert.That(sequence.Count(), Is.EqualTo(5)); } }