Ejemplo n.º 1
0
        public void GivenViewModel_WhenAssemble_ThenItAssembleToModel()
        {
            Mock <HardwareViewModel> viewModel = new Mock <HardwareViewModel>();

            viewModel.SetupGet(m => m.ShortName).Returns(ShortName);
            viewModel.SetupGet(m => m.UnitSymbol).Returns(Unit);
            viewModel.SetupGet(m => m.MainValue).Returns(MainValue);

            IHardwareInfo model = HardwareAssembler.AssembleFromViewModel(viewModel.Object);

            Assert.NotNull(model);
            Assert.Equal(ShortName, model.ShortName);
            Assert.Equal(Unit, model.UnitSymbol);
            Assert.Equal(MainValue, model.MainValue);
        }
Ejemplo n.º 2
0
        public void GivenModel_WhenAssemble_ThenItAssembleToViewModel()
        {
            Mock <IHardwareInfo> model = new Mock <IHardwareInfo>();

            model.SetupGet(m => m.ShortName).Returns(ShortName);
            model.SetupGet(m => m.UnitSymbol).Returns(Unit);
            model.SetupGet(m => m.MainValue).Returns(MainValue);

            HardwareViewModel vm = HardwareAssembler.AssembleFromModel(model.Object);

            Assert.NotNull(vm);
            Assert.Equal(ShortName, vm.ShortName);
            Assert.Equal(Unit, vm.UnitSymbol);
            Assert.Equal(MainValue, vm.MainValue);
        }