public ActionResult Index(ColorVm vm, string ColorList) { ColorService colorservice = new ColorService(); vm.ColorCount = colorservice.ColorCount; vm.ColorList = colorservice.ColorList; vm.SelectedColorName = colorservice.GetColorName(vm.SelectedColorCode); return(View(vm)); }
public void ShouldReturnColorName() { const string colors = "purple\nyellow\norange\n"; _dataManager.Setup(x => x.GetData(DataType.Color)).Returns(colors); var service = new ColorService(_dataManager.Object, _randomNumberGenerator); var name = service.GetColorName(); colors.ShouldContain(name); name.Length.ShouldBe(6); }
private string GetColorNameContext() { return(_service.GetColorName()); }