Exemplo n.º 1
0
        public async Task Selects_All_Attributes()
        {
            // Arrange
            var expected = 2;

            using (var context = new DueltankDbContext(_dbContextOptions))
            {
                context.Attribute.Add(new Attribute
                {
                    Name    = "Earth",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });
                context.Attribute.Add(new Attribute
                {
                    Name    = "Water",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });

                context.SaveChanges();
            }

            // Act
            var result = await _sut.AllAttributes();

            // Assert
            result.Count.Should().Be(expected);
        }