Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Must tests added

  • Loading branch information...
commit 61e84054c02ccb7f34c96e63816e71f73110a750 1 parent fd03bd4
@danseid authored
Showing with 51 additions and 0 deletions.
  1. +51 −0 src/test/kotlin/MustTest.kt
View
51 src/test/kotlin/MustTest.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2012 Daniel Seidler
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import org.junit.Test as test
+import org.katchers.*
+import kotlin.test.assertTrue
+
+/**
+ * @author Daniel Seidler
+ * @since 2012/11/23
+ */
+public class MustTest {
+
+ test fun mustBeAnyMatcher() {
+ assertTrue(Any().must(be) is AnyBeMatcher<Any>)
+ assertTrue(Any().must(!be) is AnyNotBeMatcher<Any>)
+ }
+
+ test fun mustBeStringMatcher() {
+ assertTrue(String().must(be) is AnyBeMatcher<String>)
+ assertTrue(String().must(!be) is AnyNotBeMatcher<String>)
+ assertTrue(String().must(contain) is StringContainMatcher)
+ assertTrue(String().must(!contain) is StringNotContainMatcher)
+ assertTrue(String().must(start) is StringStartMatcher)
+ assertTrue(String().must(!start) is StringNotStartMatcher)
+ assertTrue(String().must(end) is StringEndMatcher)
+ assertTrue(String().must(!end) is StringNotEndMatcher)
+ assertTrue(String().must(have) is StringHaveMatcher)
+ assertTrue(String().must(!have) is StringNotHaveMatcher)
+ }
+
+ test fun mustBeFunctionMatcher() {
+ assertTrue({}.must(fail) is FunctionFailMatcher<Unit>)
+ assertTrue({}.must(!fail) is FunctionNotFailMatcher<Unit>)
+ assertTrue({"string"}.must(fail) is FunctionFailMatcher<String>)
+ assertTrue({"string"}.must(!fail) is FunctionNotFailMatcher<String>)
+
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.