public void UploadInvalidMappingsFile() { String mappingFileText = "StackHash Unit Test for testing invalid mapping file upload - runs twice a day"; m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true); m_Utils.ActivateContext(0); UploadMappingFileResponse resp = m_Utils.UploadMappingFile(0, mappingFileText, 120000); Assert.AreEqual(StackHashServiceResult.Success, resp.ResultData.Result); Assert.AreEqual(null, resp.ResultData.LastException); // Check the admin report. Assert.AreNotEqual(null, m_Utils.UploadMappingFileAdminReport.LastException); Assert.AreEqual(StackHashServiceErrorCode.InvalidMappingFileFormat, m_Utils.UploadMappingFileAdminReport.ServiceErrorCode); }
public void UploadValidMappingsFile() { String mappingFileText = File.ReadAllText(@"R:\stackhash\BusinessLogic\BusinessLogic\TestData\MappingFiles\1.0.4511.261.xml"); if (!File.Exists(mappingFileText)) { return; } m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true); m_Utils.ActivateContext(0); UploadMappingFileResponse resp = m_Utils.UploadMappingFile(0, mappingFileText, 60000); Assert.AreEqual(StackHashServiceResult.Success, resp.ResultData.Result); Assert.AreEqual(null, resp.ResultData.LastException); // Check the admin report. Assert.AreEqual(null, m_Utils.UploadMappingFileAdminReport.LastException); Assert.AreEqual(StackHashServiceErrorCode.NoError, m_Utils.UploadMappingFileAdminReport.ServiceErrorCode); }