Beispiel #1
0
        public async Task GetAsync_WillReturnNull_WhenNotExists(int iteration)
        {
            // Arrange
            sut = new MoamrathRepository(_db);

            // Act
            Moamrath result = await sut.GetAsync(Guid.NewGuid());

            // Assert
            Assert.Null(result);
        }
Beispiel #2
0
        public async Task GetAsyncMultiple_WillReturnAllMatchingEntities(params Guid[] ids)
        {
            // Arrange
            sut = new MoamrathRepository(_db);

            // Act
            IEnumerable <Moamrath> result = await sut.GetAsync(ids);

            // Assert
            Assert.NotEmpty(result);
            Assert.Equal(ids.Length, result.Count());
        }
Beispiel #3
0
        public async Task GetAsyncMultiple_WillReturnOnlyThoseWithMatchingKeys(string id1, string id2)
        {
            // Arrange
            sut = new MoamrathRepository(_db);

            // Act
            IEnumerable <Moamrath> result = await sut.GetAsync(Guid.Parse(id1), Guid.Parse(id2), Guid.NewGuid());

            // Assert
            Assert.NotEmpty(result);
            Assert.Equal(2, result.Count());
        }
Beispiel #4
0
        public async Task GetAsync_WillReturnTheCorrectValue_WhenExists(string id)
        {
            // Arrange
            sut = new MoamrathRepository(_db);

            // Act
            Moamrath result = await sut.GetAsync(Guid.Parse(id));

            // Assert
            Assert.NotNull(result);
            Assert.Equal(Guid.Parse(id), result.Id);
        }