예제 #1
0
        public void GetPriceOfTheConnection_ValidPhoneAndTimeOfConnection_CorrectValue()
        {
            //Arrange
            const int     TIME_OF_CONNECTION = 50;
            const decimal TOTAL_COST         = 50 * 0.60M / 60;

            var dataObjectMapperMock           = new Mock <IDataObjectMapper>();
            var subscribersSystemDbContextMock = new Mock <ISubscribersSystemDbContext>();

            var phoneService = new PhoneService(() => subscribersSystemDbContextMock.Object, dataObjectMapperMock.Object);

            //Act
            var result = phoneService.GetPriceOfTheConnection(validPhone, TIME_OF_CONNECTION);

            //Assert
            Assert.AreEqual(TOTAL_COST, result);
        }