Exemplo n.º 1
0
        public void ToDto_ReturnsProperObjecct()
        {
            //Arrange
            Quotation quotation = getDefaultQuotation();

            //Act
            QuotationDto dto         = quotation.ToDto();
            QuotationDto expectedDto = getDefaultQuotationDto();

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

            Assert.IsTrue(areEqual);
        }
Exemplo n.º 2
0
        public void CopyProperties_AfterwardAllPropertiesAreEqual()
        {
            //Arrange
            var baseItem = new QuotationDto()
            {
                QuotationId = 1,
                PriceDate   = new DateTime(2017, 3, 4, 21, 10, 0),
                AssetId     = 1,
                TimeframeId = 1,
                OpenPrice   = 1.03,
                HighPrice   = 1.04,
                LowPrice    = 1.02,
                ClosePrice  = 1.04,
                Volume      = 100,
                IndexNumber = 51
            };

            var comparedItem = new QuotationDto()
            {
                QuotationId = 2,
                PriceDate   = new DateTime(2017, 3, 4, 21, 10, 0),
                AssetId     = 2,
                TimeframeId = 1,
                OpenPrice   = 1.05,
                HighPrice   = 1.02,
                LowPrice    = 1.01,
                ClosePrice  = 1.03,
                Volume      = 103,
                IndexNumber = 52
            };

            //Act
            comparedItem.CopyProperties(baseItem);
            var areEqual = baseItem.Equals(comparedItem);

            //Assert
            Assert.IsTrue(areEqual);
        }