예제 #1
0
        public void ShouldTestHourlyShareRate()
        {
            CheckPropertyValidation cpv = new CheckPropertyValidation();
            HourlyShareRate         hsr = new HourlyShareRate();

            hsr.Id = 5;

            var errorCount = cpv.myValidation(hsr).Count;

            Assert.AreEqual(1, errorCount);
        }
예제 #2
0
        public void ShouldTestTrade()
        {
            Trade trade = new Trade();

            trade.Id          = 10;
            trade.Symbol      = "XYT";
            trade.NoOfShares  = 10;
            trade.PortfolioId = 5;
            trade.Price       = 10;
            trade.Action      = "TYZ";
            CheckPropertyValidation cpv = new CheckPropertyValidation();
            var errorCount = cpv.myValidation(trade).Count;

            Assert.AreEqual(0, errorCount);
        }
예제 #3
0
        public void ShouldTestTradeAnalysis()
        {
            TradeAnalysis tradeAnalysis = new TradeAnalysis();

            tradeAnalysis.Action  = "BUY";
            tradeAnalysis.Sum     = 200;
            tradeAnalysis.Maximum = 100;
            tradeAnalysis.Minimum = 100;
            tradeAnalysis.Average = 100;


            CheckPropertyValidation cpv = new CheckPropertyValidation();
            var errorCount = cpv.myValidation(tradeAnalysis).Count;

            Assert.AreEqual(0, errorCount);
        }
예제 #4
0
        public void ShouldTestTradeModel()
        {
            TradeModel tradeModel = new TradeModel();

            tradeModel.Action     = "BUY";
            tradeModel.NoOfShares = 10;

            tradeModel.PortfolioId = 1;
            tradeModel.Symbol      = "ABC";



            CheckPropertyValidation cpv = new CheckPropertyValidation();
            var errorCount = cpv.myValidation(tradeModel).Count;

            Assert.AreEqual(0, errorCount);
        }