-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
125 lines (116 loc) · 5.06 KB
/
index.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<title>Test-First Teaching: learn_c-sharp: pig latin</title>
<link href="../assets/style.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="header">
<h1><a href="http://testfirst.org">TestFirst.org</a></h1>
<h2>the home of test-first teaching</h2>
</div>
<div class="nav">
<h2><a href="../index.html">learn_c-sharp</a></h2>
<b>Labs:</b>
<ul>
<li><a href="../00_hello/index.html">00 Hello</a></li>
<li><a href="../01_Calculator/index.html">01 Calculator</a></li>
<li><a href="../02_Bottles/index.html">02 Bottles</a></li>
<li><a href="../03_Simon_Says/index.html">03 Simon Says</a></li>
<li>04 Pig Latin</li>
<li><a href="../05_temperature/index.html">05 Temperature</a></li>
<li><a href="../06_book_titles/index.html">06 Book titles</a></li>
<li><a href="../07_timer/index.html">07 Timer</a></li>
<li><a href="../08_orange_tree/index.html">08 Orange Tree</a></li>
<li><a href="../09_portfolio/index.html">09 Portfolio</a></li>
<li><a href="../10_collections/index.html">10 Collections</a></li>
<li><a href="../11_file/index.html">11 File</a></li>
<li><a href="../12_employee/index.html">12 Employee</a></li>
</ul>
</div>
<h1>pig latin</h1>
<div class="content">
<div class="rspec_file">
<div class="intro">
<p>
Pig Latin
Pig Latin is a made-up children's language that's intended to be confusing. It obeys a few simple rules (below) but when it's spoken quickly
it's really difficult for non-children (and non-native speakers) to understand.
Rule 1: If a word begins with a vowel sound, add an "ay" sound to the end of the word.
Rule 2: If a word begins with a consonant sound, move it to the end of the word, and then add an "ay" sound to the end of the word.
(There are a few more rules for edge cases, and there are regional variants too, but that should be enough to understand the tests.)
See <http://en.wikipedia.org/wiki/Pig_latin> for more details.
</p>
<h1>Topics</h1>
<ul>
<li>strings</li>
</ul>
<h1>Simon Says</h1>
</div>
<div class="tests">
<h1>Tests</h1>
<a class="raw_file" href="../04_Pig_Latin/04_Pig_Latin/PigLatinTests.cs">PigLatinTests.cs</a>
<pre>
[TestMethod]
public void TranslateWordBeginningWithAVowel()
{
Translator translator = new Translator();
Assert.AreEqual("appleay", translator.Translate("apple"));
}
[TestMethod]
public void TranslateWordBeginningWithAConsonant()
{
Translator translator = new Translator();
Assert.AreEqual("ananabay", translator.Translate("banana"));
}
[TestMethod]
public void TranslateWordBeginningWithTwoConsonants()
{
Translator translator = new Translator();
Assert.AreEqual("errychay", translator.Translate("cherry"));
}
[TestMethod]
public void TranslateTwoWords()
{
Translator translator = new Translator();
Assert.AreEqual("eatay iepay", translator.Translate("eat pie"));
}
[TestMethod]
public void TranslateWordBeginningWithThreeConsonants()
{
Translator translator = new Translator();
Assert.AreEqual("eethray", translator.Translate("three"));
}
[TestMethod]
public void Count_SCH_AsASinglePhoneme()
{
Translator translator = new Translator();
Assert.AreEqual("oolschay", translator.Translate("school"));
}
[TestMethod]
public void Count_QU_AsASinglePhoneme()
{
Translator translator = new Translator();
Assert.AreEqual("ietquay", translator.Translate("quiet"));
}
[TestMethod]
public void Count_QU_AsAConsonantEvenWhenPreceededByAConsonant()
{
Translator translator = new Translator();
Assert.AreEqual("aresquay", translator.Translate("square"));
}
[TestMethod]
public void TranslateManyWords()
{
Translator translator = new Translator();
Assert.AreEqual("ethay ickquay ownbray oxfay", translator.Translate("the quick brown fox"));
}
//Test-driving bonus:
// write a test asserting that capitalized words are still capitalized (but with a different initial capital letter, of course)
// retain the punctuation from the original phrase
</pre>
</div>
</div>
</div>
<div class="footer"><a href="http://testfirst.org">TestFirst.org</a></div>
</body>
</html>