All Downloads are FREE. Search and download functionalities are using the official Maven repository.

core.pure.test.testable.pure Maven / Gradle / Ivy

There is a newer version: 4.57.1
Show newest version
// Copyright 2022 Goldman Sachs
//
// 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 meta::pure::data::*;

import meta::pure::test::*;
import meta::pure::test::assertion::*;
import meta::pure::test::result::*;

Class <> meta::pure::test::TestSuite extends Test
{
  doc: String[0..1];
}

Class <> meta::pure::test::AtomicTest extends Test
{
    doc: String[0..1];
    assertions  : TestAssertion[1..*];
}

Association meta::pure::test::TestSuiteAtomicTest
{
    suite       : TestSuite[0..1];   
    tests       : AtomicTest[1..*];
}

Class <> meta::pure::test::result::TestResult
{
    test        : AtomicTest[1];
}

Class meta::pure::test::result::TestError extends TestResult
{
    message     : String[1];
}

Class meta::pure::test::result::TestExecuted extends TestResult
{
    assertStatuses  : AssertionStatus[*];

    executionStatus()
    {
       if($this.assertStatuses->forAll(as | $as->instanceOf(AssertPass)),
          | TestExecutionStatus.PASS,
          | TestExecutionStatus.FAIL)
    }: TestExecutionStatus[1];
}

Enum meta::pure::test::result::TestExecutionStatus
{
    PASS,
    FAIL
}

Class <> meta::pure::test::assertion::AssertionStatus
{
    id          : String[1];
}

Class meta::pure::test::assertion::AssertPass extends AssertionStatus
{
}

Class meta::pure::test::assertion::AssertFail extends AssertionStatus
{
    message     : String[1];
}

Class meta::pure::test::assertion::EqualToJsonAssertFail extends AssertFail
{
    expected    : String[1];
    actual      : String[1];
}

Class <> meta::pure::test::assertion::TestAssertion
{
    id          : String[1]; 
}

Class meta::pure::test::assertion::EqualTo extends TestAssertion
{
    expected    : Any[1];
}

Class meta::pure::test::assertion::EqualToJson extends TestAssertion
{
    expected    : EmbeddedData[1];
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy