Giter VIP home page Giter VIP logo

bitmind-decisions's Introduction

Bitmind - Decision Making Assistant (University Project)

Cover image for the Bitmind project with a screenshot of its graphical user interface on Windows 10.

A desktop app to help journal tough decisions, possible choices, and the consequences of those choices.

Development instructions using the IntelliJ IDE

  1. Install the Java 11 JDK.
  2. Install the JavaFX library (it's no longer bundled with the JDK).
  3. Load the project.
  4. File > Project Structure... > Project > Project SDK: Set to Java 11. Click OK.
  5. Right click and run the source file: src/main/ca.ubc.cs.cpsc210/ui/App.java so it appears in Configurations in the top right.
  6. Click the Configurations dropdown and click Edit Configurations....
  7. Add the following to VM options:
--module-path ${JAVAFX_LIB_PATH}
--add-modules javafx.controls,javafx.fxml,javafx.graphics
--add-exports=javafx.graphics/com.sun.javafx.css=ALL-UNNAMED

Set an environment variable called JAVAFX_LIB_PATH or replace ${JAVAFX_LIB_PATH} with the path to your JavaFX installation.

On my Windows machine, I installed JavaFX at C:\lib\javafx-sdk-11.0.2\lib. On my Linux machine, I installed it at /usr/share/java/.

  1. You're ready to go. Build and have fun!
    • Tip: You can clean the build using Build > Build Artifacts... > Clean.

bitmind-decisions's People

Contributors

pseigo avatar pcarterubc avatar

Watchers

James Cloos avatar  avatar

bitmind-decisions's Issues

Test date-dependent code with different dates

Testing Dates

entry.Journal adjusts its lastEntryDateTime if the most recent existing entry is removed. It would be a good idea to make sure that the dates actually change, but I'm pretty sure the current interface does not support any custom Clocks or times. I could add functionality to allow times to be set relative to a different Clock for the sake of testability, but perhaps it would be best if this was possible without exposing the inner workings of the class. It could be part of the Journal constructor?

I think I have some tests about creating objects that are/use EntryDateTime and make sure that the returned date is the same. For example, in EntryDateTimeTest we have

private EntryDateTime entryDateTime;
// ...
@Test
public void testNow() {
    entryDateTime = EntryDateTime.now();
    testDate = ZonedDateTime.now().toLocalDate();
    assertEquals(formatShort(testDate), entryDateTime.dateShort());
}

This is pretty much just duplicating the implementation of EntryDateTime.

In JournalTest,

@Test
public void testAddEntry() {
    EntryDateTime dateTimeNow = EntryDateTime.now();
    Entry entry = new Entry("This is the description");
    journal.add(entry);

    assertEquals(1, journal.size());

    try {
        assertEquals(dateTimeNow.dateShort(), journal.lastEntryDateShort());
    } catch (NoEntriesAddedException e) {
        fail("caught " + e.toString() + " when unexpected");
    }
    // ...
}

This is creating a date, dateTimeNow, and comparing it with the entry to make sure they have the same date. This code assumes that both lines will be executed at exactly the same time. In reality, they are probably some small amount of time off which might cause this test to fail in certain circumstances. This approach will not scale to testing anything with seconds or minutes.

Resources

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.