示例#1
0
        public SimpleListItemViewModel SimpleListItemToSimpleListItemViewModel(DataModel.Models.SimpleListItem simpleListItem)
        {
            SimpleListItemViewModel simpleListItemViewModel = new SimpleListItemViewModel();

            simpleListItemViewModel.ID           = simpleListItem.ID;
            simpleListItemViewModel.Done         = simpleListItem.Done;
            simpleListItemViewModel.Description  = simpleListItem.Description;
            simpleListItemViewModel.SimpleListID = simpleListItem.SimpleListID;
            return(simpleListItemViewModel);
        }
示例#2
0
        public void SimpleListItemToSimpleListItemViewModelTest()
        {
            Mapper         target         = new Mapper(); // TODO: Initialize to an appropriate value
            SimpleListItem simpleListItem = new DataModel.Models.SimpleListItem {
                ID = 1, Description = "test list item 1", Done = false, SimpleListID = 1
            };
            SimpleListItemViewModel expected = new SimpleListItemViewModel {
                ID = 1, Description = "test list item 1", Done = false, SimpleListID = 1
            };
            SimpleListItemViewModel actual;

            actual = target.SimpleListItemToSimpleListItemViewModel(simpleListItem);
            Assert.AreEqual(expected.Description, actual.Description);
            Assert.AreEqual(expected.Done, actual.Done);
            Assert.AreEqual(expected.ID, actual.ID);
            Assert.AreEqual(expected.SimpleListID, actual.SimpleListID);
        }