Git Product home page Git Product logo

finished-test's Introduction

This project is part of the pre-course. It contains test with the following form

@Test
void should_format_string() {
    final String name = "Harry";
    final int age = 23;

    String text = String.format("Hello, %s. Next year, you will be %d.", name, age);

    // TODO: please modify the following code to pass the test
    // <--start
    final String expectedText = "";
    // --end-->

    assertEquals(expectedText, text);
}

The test contained in this project will fail by default. DO NOT run the test first! Please read the test to get a basic idea, then try to correct the test following the hint TODO comment. You are only permitted to modify code between <--start and --end-->.

For example. In the test above, we can get the idea that the knowledge point is how to format string using a template. After reading the code, we can do the following update:

    // TODO: please modify the following code to pass the test
    // <--start
    final String expectedText = "Hello, Harry. Next year, you will be 23.";
    // --end-->
// --end-->

Then we can run the test again after modification to see if the test is corrected. If it is succeeded, please check all the codes related to this test (including the dependency demo class) and make sure you have fully understood them; while, if it fails again, please check the reason and try to correct it again.

finished-test's People

Watchers

Cheng Ruoqian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.