public CategoriesNavigationViewModel(TelerikAcademy.FinalProject.Data.Model.Category category) { if (category != null) { this.Id = category.Id; this.Name = category.Name; } }
public void ConstructorShould_SetCorrectName_WhenCorrectCategoryModelIsPassed() { // Arrange TelerikAcademy.FinalProject.Data.Model.Category categoryModel = new TelerikAcademy.FinalProject.Data.Model.Category(); //Act categoryModel.Name = "Test"; CategoriesNavigationViewModel viewModel = new CategoriesNavigationViewModel(categoryModel); //Assert Assert.AreEqual(viewModel.Name, categoryModel.Name); }