87 lines
4.2 KiB
Ruby
87 lines
4.2 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
|
|
end
|