public void ThenFileStatusShouldUpdateToRejectionWithOptionToStartAgain() { //Implement front end part here before below code int rowReturned = DBConnectHelper.RowReturnedQuery("Select * from ECO.MeasuresProcessingError where FileName" + " ='MP_311204_December2018_Measure_Processing_Errors.csv' and StatusProcessingError = 5", DatabaseName.ECO); Assert.AreEqual(rowReturned, 7); bool deleteFile = DBConnectHelper.DeleteRow("dbo.documents", "fileName", Path.GetFileName(suppliersMRNsFile2), DatabaseName.Documents); Assert.IsTrue(deleteFile); bool deleteErrors = DBConnectHelper.DeleteRow("ECO.MeasuresProcessingError", "fileName", Path.GetFileName(suppliersMRNsFile2), DatabaseName.ECO); Assert.IsTrue(deleteErrors); StartAgain(); }
public void ThenFileRecordWillContainFilenameUploadedUsernameAndCreationTimestamp(string p0) { string fileName = Path.GetFileName(validFile); switch (p0) { case "Initial Upload": GetFileDetailsInDB(fileName, 1, p0); break; case "Duplicate Upload": GetFileDetailsInDB(fileName, 2, p0); bool deleteFile = DBConnectHelper.DeleteRow("dbo.documents", "fileName", fileName, DatabaseName.Documents); Assert.IsTrue(deleteFile); break; } }
public void ThenFileWillBeProcessedWithRecordCreatedInDatabase(string p0) { Logger.Info("Verifying database for file deatils"); string fileName = WhichFile(p0); int numOfRows = DBConnectHelper.RowReturnedQuery("Select * from dbo.documents where filename = '" + fileName + "'; ", DatabaseName.Documents); Assert.AreEqual(1, numOfRows); List <DatabaseResult> output = DBConnectHelper.GetQueryResult( "SELECT Version,DocId,Created_at FROM dbo.Documents where filename = '" + fileName + "' order by Created_at desc", DatabaseName.Documents); string todaysDate = DateTime.Now.ToString("M/d/yyyy"); string dateRetrievedFromDB = output[0].thirdColumn.Split(' ')[0]; Assert.AreEqual(todaysDate, dateRetrievedFromDB); bool deleteFile = DBConnectHelper.DeleteRow("dbo.documents", "fileName", fileName, DatabaseName.Documents); Assert.IsTrue(deleteFile); }