Beispiel #1
0
        internal static SelectedNumber DbToCommon(this DbSelectedNumber dbSelectedNumber)
        {
            SelectedNumber selectedNumber = new SelectedNumber()
            {
                FirstNumber  = dbSelectedNumber.FirstNumber,
                Id           = dbSelectedNumber.Id,
                SecondNumber = dbSelectedNumber.SecondNumber,
                ThirdNumber  = dbSelectedNumber.ThirdNumber,
                LineId       = dbSelectedNumber.LineId
            };

            return(selectedNumber);
        }
Beispiel #2
0
        internal static DbSelectedNumber CommonToDb(this SelectedNumber selectedNumber)
        {
            DbSelectedNumber dbSelectedNumber = new DbSelectedNumber()
            {
                Id           = selectedNumber.Id,
                FirstNumber  = selectedNumber.FirstNumber,
                SecondNumber = selectedNumber.SecondNumber,
                ThirdNumber  = selectedNumber.ThirdNumber,
                LineId       = selectedNumber.LineId
            };

            return(dbSelectedNumber);
        }
Beispiel #3
0
        public void DbToCommon_GetSelectedNumber_Convert()
        {
            //Arrange
            var commonSelectedNumber = new SelectedNumber();
            var dbSelectedNumber     = new DbSelectedNumber();

            var fake = A.Fake <SelectedNumber>(o => o.Wrapping(commonSelectedNumber));
            //Act
            var results = dbSelectedNumber.DbToCommon();

            A.CallTo(() => fake.Equals(A <object> ._)).ReturnsLazily(
                call =>
            {
                var other = call.GetArgument <SelectedNumber>(0);
                return(results.Id == other.Id);
            });
            //Assert
            Assert.AreEqual(fake, results);
        }