Esempio n. 1
0
        public void ConvertEntityToModel_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            //var repository = new BranchRepository(context);
            var    service = new BranchService();
            branch entity  = context.branch.Where(x => x.id == 1).FirstOrDefault();

            // Act
            BranchModel model = service.ConvertEntityToModel(entity);

            // Assert
            Assert.IsNotNull(model);
            Assert.AreEqual(model.Id, entity.id);
            Assert.AreEqual(model.Name, entity.name);
            Assert.AreEqual(model.IsDefault, entity.isDefault);
            Assert.AreEqual(model.IsCurrent, entity.isCurrent);
        }