/* * Receive data stream from database. * * The method is public. * * Input: Data stream with content from database. * Output: Data split into target format. */ public void v_OutputHandler_ReceiveDataStream(String string_Content) { /* Read from datastorage */ string myTest = myIoDatastorage.string_IoDataStorage_ReadDataFromStorage(Storage.s_PathTextfile); //"C:\\Users\\mfle\\Desktop\\myFile.txt"); //string myTest = myIoDatastorage.int_IoDatastorage_WriteDataToStorage(string_Content, Storage.s_PathTextfile); //System.Diagnostics.Debug.WriteLine("Ersatz: " + myTest); return; }
/* * Receive and verify input string. * * The method is public. * * Input: String user input. * Output: 1 if user input is valid, is not in database. * 0 if user input is not valid, is in database. */ public string int_InputHandler_VerifyUserInput(String string_UserInput) { /* Write into data storage */ mydatastorage.int_IoDatastorage_WriteDataToStorage(string_UserInput, Storage.s_PathTextfile); // "C:\\Users\\mfle\\Desktop\\myFile.txt"); /* Read from written data storage. */ string myTest = mydatastorage.string_IoDataStorage_ReadDataFromStorage(Storage.s_PathTextfile); return(myTest); }
public void int_IoDatastorage_WriteDataToStorage() { //arrange IoDatastorage myModel = new IoDatastorage(); IoDatastorage myIoDatastorage = new IoDatastorage(); String formalizedString = ",Hallo[17.05.2021 00:00:00]"; String string_Data = ""; int retVal = -1; //act File.WriteAllText(Storage.s_PathTextfile, ""); retVal = myModel.int_IoDatastorage_WriteDataToStorage(formalizedString, Storage.s_PathTextfile); string_Data = myIoDatastorage.string_IoDataStorage_ReadDataFromStorage(string_Data); //assert Assert.Equal(formalizedString, string_Data); Assert.Equal(0, retVal); // expect 0 for successful "transaction" }
public void v_OutputHandler_ReceiveDataStream() { //arrange OutputHandler myOutputHandler = new OutputHandler(); IoDatastorage myIoDatastorage = new IoDatastorage(); String input = "Das ist mein Inhalt[17.05.2021 00:00:00]"; String string_Data = ""; Moq.Mock mock1 = new Mock <OutputHandler.iFoo>(); //FakeOrder mockOrder = new FakeOrder(); //OutputHandler purchase = new OutputHandler(); //act File.WriteAllText(Storage.s_PathTextfile, input); myOutputHandler.v_OutputHandler_ReceiveDataStream(input); string_Data = myIoDatastorage.string_IoDataStorage_ReadDataFromStorage(string_Data); //assert Assert.Equal(input, string_Data); }