/// <summary> /// Constructor /// </summary> /// <param name="salesController">An ISalesController implementation.</param> public MainViewModel(ISalesController salesController) { _salesController = salesController; NumpadViewModel = new NumpadViewModel(); TabViewModel = new TabViewModel(salesController, NumpadViewModel); SalesViewModel = new SalesViewModel(salesController); }
public void BackgroundColor_SetColor_NotifyCalled() { var _uut = new TabViewModel(_fakeSalesController, _fakeNumpad); _uut.PropertyChanged += _fakeNotifyTest.TestINotify; _uut.BackGroundColour = "Green"; _fakeNotifyTest.Received(1).TestINotify(Arg.Any<object>(), Arg.Any<PropertyChangedEventArgs>()); }
public void SetUp() { _testProducts = new MakeProducts(); _fakeSalesController = Substitute.For<ISalesController>(); _fakeNumpad = Substitute.For<INumpad>(); _uut = new TabViewModel(_fakeSalesController, _fakeNumpad); _fakeNotifyTest = Substitute.For<INotifyTest>(); _testProducts.AddProductTab(true, "Red", 1, "RedStuff", 1); _testProducts.AddProductType("Red", 1, 20, "RedSnask", 1); _testProducts.AddProductGroup("RedHat", 2, 1, 1); _testProducts.AddProduct("GreenAle", 20, true, 1, 1, 2); }