Ejemplo n.º 1
0
        public void CloneSimpleListTest()
        {
            var simpleListEntities    = new SimpleListEntities(Settings.Default.connectionString);
            var simpleListRespository = new SimpleListRepository(simpleListEntities);
            var userRespository       = new UserRepository(simpleListEntities);
            var user = userRespository.GetUser("bernard");
            var simpleListOriginalFromDb = simpleListRespository.GetSimpleLists(user.ID).FirstOrDefault();
            var simpleListCloned         = simpleListOriginalFromDb.Clone(user.ID, true, simpleListOriginalFromDb.Name + " - CLONED");

            simpleListRespository.AddSimpleList(simpleListCloned);
            var simpleListClonedFromDb =
                simpleListRespository.GetSimpleLists(user.ID).Where(l => l.Name == simpleListCloned.Name);

            Assert.IsNotNull(simpleListClonedFromDb);
        }
Ejemplo n.º 2
0
 public SimpleListItemRepository(SimpleListEntities _simpleListEntities)
 {
     this._simpleListEntities = _simpleListEntities;
 }
Ejemplo n.º 3
0
 public SimpleListItemRepository()
 {
     _simpleListEntities = new SimpleListEntities();
 }
Ejemplo n.º 4
0
 public UserRepository(SimpleListEntities simpleListEntities)
 {
     this._simpleListEntities = simpleListEntities;
 }
Ejemplo n.º 5
0
 public UserRepository()
 {
     _simpleListEntities = new SimpleListEntities();
 }