C-minor v0.0

TestCaseFile Class

Assembly: Topten.Cminor.Compiler.dll
Namespace: Topten.Cminor.Test

Class to work with Cminor test case files (*.cmt)

public class TestCaseFile

Inheritance

TestCaseFile → object

Remarks

A test case file consists of Cminor source code followed by a number of text sections delimted by Markdown heading 2 style dividers. The top code section is returned as a section name "Code" and the other sections are named according to their headings. eg: ## Output produces a section "Output" with the following text as its content.

Constructors

TestCaseFile(string)

Loads and parses test case file

Properties

Filename

The name of the file this test case was loaded from

Modified

Indicates if the file is modified

Methods

DeleteSection(string)

Removes a section form the file

Format()

Formats the sections back into .cmt file format

GetSection(string)

Gets the text of a section in the file, or null if doesn't exist

Save(string)

Save the file

SaveIfModified()

Save the file if modified

SetSection(string, string)

Sets the contents of a section