153 lines
7.8 KiB
Ruby
153 lines
7.8 KiB
Ruby
require_relative "../lib/verb"
|
|
require "minitest/autorun"
|
|
|
|
class TestVerb < Minitest::Test
|
|
def setup
|
|
@miru = IchidanVerb.new("見る", "みる", "to look")
|
|
@nomu = GodanVerb.new("飲む", "のむ", "to drink")
|
|
@au = GodanVerb.new("会う", "あう", "to meet")
|
|
@matsu = GodanVerb.new("待つ", "まつ", "to wait")
|
|
@toru = GodanVerb.new("取る", "とる", "to take")
|
|
@yomu = GodanVerb.new("読む", "よむ", "to read")
|
|
@asobu = GodanVerb.new("遊ぶ", "あそぶ", "to play")
|
|
@shinu = GodanVerb.new("死ぬ", "しぬ", "to die")
|
|
@kaku = GodanVerb.new("書く", "かく", "to write")
|
|
@iku = GodanVerb.new("行く", "いく", "to go")
|
|
@oyogu = GodanVerb.new("泳ぐ", "およぐ", "to swim")
|
|
@hanasu = GodanVerb.new("話す", "はなす", "to speak")
|
|
@suru = SuruVerb.new("する", "する", "to do")
|
|
@benkyousuru = SuruVerb.new("勉強する", "べんきょうする", "to study")
|
|
end
|
|
|
|
def test_te_form
|
|
assert_equal "見て", @miru.te.kanji
|
|
assert_equal "みて", @miru.te.kana
|
|
assert_equal "飲んで", @nomu.te.kanji
|
|
assert_equal "のんで", @nomu.te.kana
|
|
assert_equal "して", @suru.te.kanji
|
|
assert_equal "して", @suru.te.kana
|
|
assert_equal "勉強して", @benkyousuru.te.kanji
|
|
assert_equal "べんきょうして", @benkyousuru.te.kana
|
|
assert_equal "会って", @au.te.kanji
|
|
assert_equal "待って", @matsu.te.kanji
|
|
assert_equal "取って", @toru.te.kanji
|
|
assert_equal "読んで", @yomu.te.kanji
|
|
assert_equal "遊んで", @asobu.te.kanji
|
|
assert_equal "死んで", @shinu.te.kanji
|
|
assert_equal "書いて", @kaku.te.kanji
|
|
assert_equal "行って", @iku.te.kanji
|
|
assert_equal "泳いで", @oyogu.te.kanji
|
|
assert_equal "話して", @hanasu.te.kanji
|
|
end
|
|
|
|
def test_long_form_present_positive
|
|
assert_equal "見ます", @miru.long_form_present_positive.kanji
|
|
assert_equal "みます", @miru.long_form_present_positive.kana
|
|
assert_equal "飲みます", @nomu.long_form_present_positive.kanji
|
|
assert_equal "のみます", @nomu.long_form_present_positive.kana
|
|
assert_equal "します", @suru.long_form_present_positive.kanji
|
|
assert_equal "します", @suru.long_form_present_positive.kana
|
|
assert_equal "勉強します", @benkyousuru.long_form_present_positive.kanji
|
|
assert_equal "べんきょうします", @benkyousuru.long_form_present_positive.kana
|
|
end
|
|
|
|
def test_long_form_present_negative
|
|
assert_equal "見ません", @miru.long_form_present_negative.kanji
|
|
assert_equal "みません", @miru.long_form_present_negative.kana
|
|
assert_equal "飲みません", @nomu.long_form_present_negative.kanji
|
|
assert_equal "のみません", @nomu.long_form_present_negative.kana
|
|
assert_equal "しません", @suru.long_form_present_negative.kanji
|
|
assert_equal "しません", @suru.long_form_present_negative.kana
|
|
assert_equal "勉強しません", @benkyousuru.long_form_present_negative.kanji
|
|
assert_equal "べんきょうしません", @benkyousuru.long_form_present_negative.kana
|
|
end
|
|
|
|
def test_short_form_present_positive
|
|
assert_equal "見る", @miru.short_form_present_positive.kanji
|
|
assert_equal "みる", @miru.short_form_present_positive.kana
|
|
assert_equal "飲む", @nomu.short_form_present_positive.kanji
|
|
assert_equal "のむ", @nomu.short_form_present_positive.kana
|
|
assert_equal "する", @suru.short_form_present_positive.kanji
|
|
assert_equal "する", @suru.short_form_present_positive.kana
|
|
assert_equal "勉強する", @benkyousuru.short_form_present_positive.kanji
|
|
assert_equal "べんきょうする", @benkyousuru.short_form_present_positive.kana
|
|
end
|
|
|
|
def test_short_form_present_negative
|
|
assert_equal "見ない", @miru.short_form_present_negative.kanji
|
|
assert_equal "みない", @miru.short_form_present_negative.kana
|
|
assert_equal "飲まない", @nomu.short_form_present_negative.kanji
|
|
assert_equal "のまない", @nomu.short_form_present_negative.kana
|
|
assert_equal "しない", @suru.short_form_present_negative.kanji
|
|
assert_equal "しない", @suru.short_form_present_negative.kana
|
|
assert_equal "勉強しない", @benkyousuru.short_form_present_negative.kanji
|
|
assert_equal "べんきょうしない", @benkyousuru.short_form_present_negative.kana
|
|
end
|
|
|
|
def test_long_form_past_positive
|
|
assert_equal "見ました", @miru.long_form_past_positive.kanji
|
|
assert_equal "みました", @miru.long_form_past_positive.kana
|
|
assert_equal "飲みました", @nomu.long_form_past_positive.kanji
|
|
assert_equal "のみました", @nomu.long_form_past_positive.kana
|
|
assert_equal "しました", @suru.long_form_past_positive.kanji
|
|
assert_equal "しました", @suru.long_form_past_positive.kana
|
|
assert_equal "勉強しました", @benkyousuru.long_form_past_positive.kanji
|
|
assert_equal "べんきょうしました", @benkyousuru.long_form_past_positive.kana
|
|
end
|
|
|
|
def test_long_form_past_negative
|
|
assert_equal "見ませんでした", @miru.long_form_past_negative.kanji
|
|
assert_equal "みませんでした", @miru.long_form_past_negative.kana
|
|
assert_equal "飲みませんでした", @nomu.long_form_past_negative.kanji
|
|
assert_equal "のみませんでした", @nomu.long_form_past_negative.kana
|
|
assert_equal "しませんでした", @suru.long_form_past_negative.kanji
|
|
assert_equal "しませんでした", @suru.long_form_past_negative.kana
|
|
assert_equal "勉強しませんでした", @benkyousuru.long_form_past_negative.kanji
|
|
assert_equal "べんきょうしませんでした", @benkyousuru.long_form_past_negative.kana
|
|
end
|
|
|
|
def test_short_form_past_positive
|
|
assert_equal "見た", @miru.short_form_past_positive.kanji
|
|
assert_equal "みた", @miru.short_form_past_positive.kana
|
|
assert_equal "飲んだ", @nomu.short_form_past_positive.kanji
|
|
assert_equal "のんだ", @nomu.short_form_past_positive.kana
|
|
assert_equal "した", @suru.short_form_past_positive.kanji
|
|
assert_equal "した", @suru.short_form_past_positive.kana
|
|
assert_equal "勉強した", @benkyousuru.short_form_past_positive.kanji
|
|
assert_equal "べんきょうした", @benkyousuru.short_form_past_positive.kana
|
|
end
|
|
|
|
def test_short_form_past_negative
|
|
assert_equal "見なかった", @miru.short_form_past_negative.kanji
|
|
assert_equal "みなかった", @miru.short_form_past_negative.kana
|
|
assert_equal "飲まなかった", @nomu.short_form_past_negative.kanji
|
|
assert_equal "のまなかった", @nomu.short_form_past_negative.kana
|
|
assert_equal "しなかった", @suru.short_form_past_negative.kanji
|
|
assert_equal "しなかった", @suru.short_form_past_negative.kana
|
|
assert_equal "勉強しなかった", @benkyousuru.short_form_past_negative.kanji
|
|
assert_equal "べんきょうしなかった", @benkyousuru.short_form_past_negative.kana
|
|
end
|
|
|
|
def test_desire
|
|
assert_equal "見たい", @miru.desire.kanji
|
|
assert_equal "みたい", @miru.desire.kana
|
|
assert_equal "飲みたい", @nomu.desire.kanji
|
|
assert_equal "のみたい", @nomu.desire.kana
|
|
assert_equal "したい", @suru.desire.kanji
|
|
assert_equal "したい", @suru.desire.kana
|
|
assert_equal "勉強したい", @benkyousuru.desire.kanji
|
|
assert_equal "べんきょうしたい", @benkyousuru.desire.kana
|
|
end
|
|
|
|
def test_potential
|
|
assert_equal "見られる", @miru.potential.dictionary.kanji
|
|
assert_equal "みられる", @miru.potential.dictionary.kana
|
|
assert_equal "飲める", @nomu.potential.dictionary.kanji
|
|
assert_equal "のめる", @nomu.potential.dictionary.kana
|
|
assert_equal "できる", @suru.potential.dictionary.kanji
|
|
assert_equal "できる", @suru.potential.dictionary.kana
|
|
assert_equal "勉強できる", @benkyousuru.potential.dictionary.kanji
|
|
assert_equal "べんきょうできる", @benkyousuru.potential.dictionary.kana
|
|
end
|
|
end
|