public void ItShouldFailOnInitialLoad()
        {
            IFundRepository fundsRepository = new FundRepository();
            MainForm mockView = new MainForm(fundsRepository);
            IPresenter presenter = mockView.Presenter;

            NUnit.Framework.Assert.IsFalse( mockView.Validate());
        }
        public void ItShouldCheckInitialLoadPresenter()
        {
            IFundRepository fundsRepository = new FundRepository();
            MainForm mockView = new MainForm(fundsRepository);
            IPresenter presenter = mockView.Presenter;

            NUnit.Framework.Assert.AreEqual(3, presenter.Total);
        }
        public void ItShouldLoadFunds()
        {
            IList<Fund> funds = new List<Fund>()
            {
            new Fund { Id=1,Stock = Stock.Equity, StockName = "Equity1", Price=10,Quantity=10,StockWeight=10 },
            new Fund { Id=2,Stock = Stock.Bond, StockName = "Bond1", Price=5,Quantity=5,StockWeight=5 },
            new Fund { Id=3,Stock = Stock.Bond, StockName = "Equity2", Price=20,Quantity=100,StockWeight=90 },
            new Fund { Id=4,Stock = Stock.Bond, StockName = "Equity3", Price=20,Quantity=100,StockWeight=90 },
            };

            IFundRepository fundsRepository = new FundRepository();
            MainForm mockView = new MainForm(fundsRepository);
            IPresenter presenter = mockView.Presenter;
            mockView.LoadFunds(funds);

            NUnit.Framework.Assert.AreEqual(4,mockView.Funds.Count);
        }
        public void ItShouldReturnObjectToAdd()
        {
            IFundRepository fundsRepository = new FundRepository();
            MainForm mockView = new MainForm(fundsRepository);
            IPresenter presenter = mockView.Presenter;

            var f = mockView.GetFund();

            NUnit.Framework.Assert.IsNotNull(f);
        }
        public void ItShouldShowInitialFundListObjectsNotNUll()
        {
            IFundRepository fundsRepository = new FundRepository();
            MainForm mockView = new MainForm(fundsRepository);
            IPresenter presenter = mockView.Presenter;

            foreach (var r in mockView.Funds)
            {
                NUnit.Framework.Assert.IsNotNull(r);
            }
        }
        public void ItShouldShowInitialFundListNotNUll()
        {
            IFundRepository fundsRepository = new FundRepository();
            MainForm mockView = new MainForm(fundsRepository);
            IPresenter presenter = mockView.Presenter;

            NUnit.Framework.Assert.IsNotNull(mockView.Funds);
        }
 public void ItShouldShowInitialFundList()
 {
     IFundRepository fundsRepository = new FundRepository();
     MainForm mockView = new MainForm(fundsRepository);
     IPresenter presenter = mockView.Presenter;
     NUnit.Framework.Assert.AreEqual(3, mockView.Funds.Count);
 }