public void int_InputHandler_VerifyUserInput() { //arrange IoDatastorage ioDatastorage = new IoDatastorage(); InputHandler inputHandler = new InputHandler(); String input = "Mein Input"; String retVal = ""; //act File.WriteAllText(Storage.s_PathTextfile, ""); retVal = inputHandler.int_InputHandler_VerifyUserInput(input); //assert Assert.Equal(input, retVal); }
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); }
/* * Constructor. */ public OutputHandler() { /**/ /* Instance of OutputHandler to read from files. */ myIoDatastorage = new IoDatastorage(); }
/* * Constructor. * * Input: Nothing. * Output: Nothing. */ public InputHandler() { /* create IO datastorage*/ mydatastorage = new IoDatastorage(); }