Archived
1

Updated Schemes

This commit is contained in:
Kim Wittenburg
2014-09-28 23:56:17 +02:00
parent 898a87058c
commit 0972e158f1
39 changed files with 84 additions and 1675 deletions

View File

@@ -1,61 +0,0 @@
//
// MPMutableExpressionTests.m
// MathPad
//
// Created by Kim Wittenburg on 19.04.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "MPExpression.h"
#import "MPFunction.h"
@interface MPMutableExpressionTests : XCTestCase
@end
@implementation MPMutableExpressionTests
- (void)testMutating {
MPMutableExpression *testExpression = [[MPMutableExpression alloc] initWithSymbols:@[@"1234", [[MPFunction alloc] init], @"5678", [[MPFunction alloc] init]]];
[testExpression appendString:@"90"];
XCTAssertEqual([testExpression numberOfSymbols], 5);
// 1234 [] 5678 [] 90
[testExpression deleteSymbolsInRange:NSMakeRange(2, 4)];
XCTAssertEqual([testExpression numberOfSymbols], 3);
// 12678 [] 90
[testExpression insertFunction:[[MPFunction alloc] init]
atIndex:2];
XCTAssertEqual([testExpression numberOfSymbols], 5);
// 12 [] 678 [] 90
[testExpression replaceSymbolsInRange:NSMakeRange(2, 5)
withSymbols:@[[[MPFunction alloc] init]]];
XCTAssertEqual([testExpression numberOfSymbols], 3);
// 12 [] 90
[testExpression setString:@"abc"];
XCTAssertEqual([testExpression numberOfSymbols], 1);
// abc
[testExpression setString:@""];
XCTAssertEqual([testExpression numberOfSymbols], 0);
//
[testExpression setString:@"1234"];
XCTAssertEqual([testExpression numberOfSymbols], 1);
}
- (void)testInvalidMutatingRange {
@try {
MPMutableExpression *testExpression = [[MPMutableExpression alloc] initWithSymbols:@[@"1234", [[MPFunction alloc] init], @"5678", [[MPFunction alloc] init]]];
[testExpression deleteSymbolsInRange:NSMakeRange(5, 17)];
XCTFail(@"Should have raised an exception");
}
@catch (NSException *exception) {}
}
@end

View File

@@ -1,34 +0,0 @@
//
// MathPadTests.m
// MathPadTests
//
// Created by Kim Wittenburg on 23.03.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface MathPadTests : XCTestCase
@end
@implementation MathPadTests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
@end