Esempio n. 1
0
        public void Create()
        {
            UnityResolver.Register();
            IBatchManager BatchManager = UnityResolver.Resolve <IBatchManager>();
            Batch         batch        = new Batch
            {
                BatchName = "37Batch" + DateTime.Now.ToString(),
                Branch    = new Branch
                {
                    BranchName = "TestBranch",

                    Institute = new Common.Models.Institute {
                        InstituteName = "Test Institute"
                    }
                }
            };
            bool ans = BatchManager.Create(batch);

            BatchManager.Save();

            Batch batch1 = BatchManager.Find(B => B.BatchName == "37Batch");

            string expected = "37Batch";
            string actual   = batch1.BatchName;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void Delete()
        {
            UnityResolver.Register();
            IBatchManager BatchManager = UnityResolver.Resolve <IBatchManager>();
            Batch         batch        = BatchManager.Find(B => B.BatchId == 115);

            bool ans = BatchManager.Delete(batch);

            BatchManager.Save();



            bool expected = true;
            bool actual   = ans;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void Update()
        {
            UnityResolver.Register();
            IBatchManager BatchManager = UnityResolver.Resolve <IBatchManager>();

            Batch batch = BatchManager.FindById(91);

            batch.BatchName = "38Batch" + DateTime.Now.ToString();

            bool isUpdate = BatchManager.Update(batch);

            BatchManager.Save();

            Batch batch1 = BatchManager.FindById(93);

            string expected = "38Batch";
            string actual   = batch1.BatchName;

            Assert.AreEqual(expected, actual);
        }