Пример #1
0
        public void Delete_Throws_NotFoundException()
        {
            // Arrange
            var repository = new SymbolConfigurationRepository();

            // Act & Assert
            Assert.Throws <EntityNotFoundException>(() => repository.Delete(Guid.NewGuid()));
        }
Пример #2
0
        public void Add_New_Configuration()
        {
            // Arrange
            var repository = new SymbolConfigurationRepository();

            // Act
            repository.Add(new SymbolConfigurationDTO());

            // Assert
            Assert.NotEmpty(repository.GetAll());
        }
Пример #3
0
        public void Add_And_Delete_New_Configuration()
        {
            // Arrange
            var repository = new SymbolConfigurationRepository();
            var allData    = repository.GetAll();

            foreach (var data in allData)
            {
                repository.Delete(data.Id);
            }

            // Act
            var dto = new SymbolConfigurationDTO("EUR", "PLN");

            var entity = repository.Add(dto);

            repository.Delete(entity.Id);

            // Assert
            Assert.False(repository.GetAll().Any());
        }