public void Squares_Success() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + ValidSource + @"Squares.txt"); //Assert Assert.AreEqual(0, run.ErrorsForTests.Count); }
public void StatementAfterProgram_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"statementAfterProgram.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void TrailingDeclarationComma_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"trailingDeclarationComma.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void NoWithOrVariables_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"noWithOrVariables.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void ValueAssignment_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"rvalueAssignment.txt"); //Assert Assert.AreEqual(2, run.ErrorsForTests.Count); }
public void NoProgramName_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"noprogname.pal.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void NonExistentType_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"nonexistentType.txt"); //Assert Assert.AreEqual(2, run.ErrorsForTests.Count); }
public void NoBooleanConditional_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"nonBooleanConditional.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void ExpressionTypeMissmatch_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SemanticErrors + @"expressionTypeMismatch.txt"); //Assert Assert.AreEqual(3, run.ErrorsForTests.Count); }
public void VariableReDeclaration_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SemanticErrors + @"variable-redeclaration.txt"); //Assert Assert.AreEqual(2, run.ErrorsForTests.Count); }
public void OUTPUTMissingIdentifiers_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + GwydMissingKeywords + @"OUTPUTMissingIdentifiers.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void InvalidIdent_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"invalidident.pal.txt"); //Assert Assert.AreEqual(2, run.ErrorsForTests.Count); }
public void UNTILMissingExpression_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + GwydMissingKeywords + @"UNITLMissingExpression.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void MissingWITH_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + GwydMissingKeywords + @"MissingWith.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void MissingELSE_Success() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + GwydMissingKeywords + @"MissingELSE.txt"); //Assert Assert.AreEqual(0, run.ErrorsForTests.Count); }
public void GwydTestFile_Success() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"validDeclarations.txt"); //Assert Assert.AreEqual(0, run.ErrorsForTests.Count); }
public void WithButNoVariables_Success() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"WithButNoVariables.txt"); //Assert Assert.AreEqual(0, run.ErrorsForTests.Count); }
public void UndeclaredIdentiferIn_LOOP_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"Invalid_UndeclaredIdentifierIn_Loop.txt"); //Assert Assert.AreEqual(3, run.ErrorsForTests.Count); }
public void Valid1_NoWhitespaceForNonKeywords_Success() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"valid1_NoWhitespaceForNonKeywords.txt"); //Assert Assert.AreEqual(0, run.ErrorsForTests.Count); }
public void MissingStatements_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + SyntaxErrors + @"missingStatements.txt"); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void Invalid_Invalid_IntAssignedToReal_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"Invalid_IntAssignedToReal.txt"); PrintErrorsFromRun(run); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void EmptyFile_Fail() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"EmptyFile.txt"); PrintErrorsFromRun(run); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void GwydTestFile_VarNotDeclared_Invalid() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"GwydInvalid_NotDeclared.txt"); PrintErrorsFromRun(run); //Assert Assert.AreEqual(2, run.ErrorsForTests.Count); }
public void GwydTestFile_Invalid_AlreadyDeclared_RealInline_Invalid() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"Invalid_AlreadyDeclared_RealInline.txt"); PrintErrorsFromRun(run); //Assert Assert.AreEqual(1, run.ErrorsForTests.Count); }
public void Invalid2_Success() { //Arrange RunCompiler run = new RunCompiler(); //Act run.Execute(SourceFolder + @"invalid2.txt"); PrintErrorsFromRun(run); //Assert Assert.AreEqual(5, run.ErrorsForTests.Count); }