-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseConverterProtoTests.cs
37 lines (33 loc) · 1.14 KB
/
BaseConverterProtoTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tonttu.Reddit.DailyProgrammer.Weekly24.BaseN;
namespace BaseN.Test {
public class BaseConverterProtoTests {
private BaseConverterProto converter;
[TestFixtureSetUp]
public void TestsSetUp() {
converter = new BaseConverterProto();
}
[TestCase(10, 2, Result = 1010)]
[TestCase(10, 3, Result = 101)]
[TestCase(10, 4, Result = 22)]
[TestCase(10, 5, Result = 20)]
[TestCase(10, 6, Result = 14)]
[TestCase(10, 7, Result = 13)]
[TestCase(10, 8, Result = 12)]
[TestCase(10, 9, Result = 11)]
[TestCase(10, 10, Result=10)]
[TestCase(100, 2, Result=1100100)]
[TestCase(100, 5, Result = 400)]
[TestCase(100, 10, Result=100)]
[TestCase(1000, 2, Result = 1111101000)]
[TestCase(1000, 5, Result = 13000)]
[TestCase(1000, 10, Result = 1000)]
public long BaseConverterProto_ConvertsCorrectly(int number, int toBase) {
return converter.Convert(number, toBase);
}
}
}