public void BaseBatch_ToFile(string fileName, string fileExtention, string path, bool timeStampToken, bool sessionIdInFileName) { //Arrange var localBatch = new BaseBatch(); localBatch.BatchContext = new ContextInvoker() { SessionId = Guid.NewGuid() }; var ExpectedFileName = createFullFileName(fileName, fileExtention, path, timeStampToken, sessionIdInFileName, localBatch.BatchContext); //Act string fullFileName = ""; var ex = Record.Exception(() => fullFileName = localBatch.ToFile("Text to write Text to write Text to write Text to write Text to write ", fileName, fileExtention, path, timeStampToken, sessionIdInFileName)); //Assert Assert.Null(ex); Assert.Equal(ExpectedFileName, fullFileName); }
public void BaseBatch_ToFileContentAndFileName() { //Arrange var localBatch = new BaseBatch(); localBatch.BatchContext = new ContextInvoker() { SessionId = Guid.NewGuid() }; //Act string fullFileName = ""; var ex = Record.Exception(() => fullFileName = localBatch.ToFile("Text to write Text to write Text to write Text to write Text to write ", "test.txt")); //Assert Assert.Null(ex); Assert.Equal("test.txt", fullFileName); }