Esempio n. 1
0
 public void AddNewSMS(SMS sMS)
 {
     using (PhoneCompanyContext context = new PhoneCompanyContext())
     {
         context.SMSs.Add(sMS.CommonToDb());
         context.SaveChanges();
     }
 }
Esempio n. 2
0
        public void CommonToDb_GetSMS_Convert()
        {
            //Arrange
            var commonSMS = new SMS();
            var dbSMS     = new DbSMS();

            var fake = A.Fake <DbSMS>(o => o.Wrapping(dbSMS));
            //Act
            var results = commonSMS.CommonToDb();

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