public void GetMarketBySymbol_returnNull_forNonExistingItem()
        {
            //Arrange
            EFMarketRepository repository = new EFMarketRepository();
            MarketDto          baseDto    = getDefaultMarketDto();

            insertMarketToTestDb(baseDto);

            //Act
            MarketDto dto = repository.GetMarketBySymbol(baseDto.ShortName + "a");

            //Assert
            Assert.IsNull(dto);
        }
        public void GetMarketBySymbol_returnProperDto_forExistingItem()
        {
            //Arrange
            EFMarketRepository repository = new EFMarketRepository();
            MarketDto          baseDto    = getDefaultMarketDto();

            insertMarketToTestDb(baseDto);

            //Act
            MarketDto dto = repository.GetMarketBySymbol(baseDto.ShortName);

            //Assert
            var areEqual = baseDto.Equals(dto);

            Assert.IsTrue(areEqual);
        }
        public void GetAllMarkets_returnProperDtoCollection()
        {
            //Arrange
            EFMarketRepository      repository = new EFMarketRepository();
            IEnumerable <MarketDto> marketDtos = getDefaultMarketDtos();

            insertMarketsToTestDb(marketDtos);

            //Act
            MarketDto[] dtos = repository.GetMarkets().ToArray();

            //Assert
            bool areEqualArrays = marketDtos.HasEqualItems(dtos);

            Assert.IsTrue(areEqualArrays);
        }