예제 #1
0
        public void Initialize_WhenThereIsNoBillToIDInDB_ReturnEmptyBillToIDList()
        {
            var         sut = new BMPresenter(databaseConnection, userName, viewer);
            BMViewModel vm  = sut.Initialize();

            Assert.That(vm.BillToIdDt.Rows.Count == 0);
        }
예제 #2
0
        public void Initialize_WhenThereAreSomeBillToIDsInDB_ReturnNotEmptyBillToIDList()
        {
            var repository = new BillToIDsRepository(databaseConnection);
            var sut        = new BMPresenter(databaseConnection, userName, viewer);

            repository.CreateBillToID("123456", userName, DateTime.Now);
            BMViewModel vm = sut.Initialize();

            Assert.That(vm.BillToIdDt.Rows, Has.Count.GreaterThan(0));
            Assert.That(vm.BillToIdDt.Rows, Has.Count.EqualTo(1));

            databaseConnection.RunSqlCommand("truncate table BillToIDs");
        }