import { describe, it } from "vitest";
import { pointsToGrade } from "../assignmentService";

describe("assignmentService", () => {
  it("pointsToGrade", () => {
    expect(pointsToGrade(24, 24)).toBe(6);
    expect(pointsToGrade(23, 24)).toBe(6);
    expect(pointsToGrade(22, 24)).toBe(5.5);
    expect(pointsToGrade(21, 24)).toBe(5.5);
    expect(pointsToGrade(20, 24)).toBe(5);
    expect(pointsToGrade(19, 24)).toBe(5);
    expect(pointsToGrade(18, 24)).toBe(5);
    expect(pointsToGrade(17, 24)).toBe(4.5);
    expect(pointsToGrade(16, 24)).toBe(4.5);
    expect(pointsToGrade(15, 24)).toBe(4);
    expect(pointsToGrade(14, 24)).toBe(4);
    expect(pointsToGrade(13, 24)).toBe(3.5);
    expect(pointsToGrade(12, 24)).toBe(3.5);
    expect(pointsToGrade(11, 24)).toBe(3.5);
    expect(pointsToGrade(10, 24)).toBe(3);
    expect(pointsToGrade(9, 24)).toBe(3);
    expect(pointsToGrade(8, 24)).toBe(2.5);
    expect(pointsToGrade(7, 24)).toBe(2.5);
    expect(pointsToGrade(6, 24)).toBe(2.5);
    expect(pointsToGrade(5, 24)).toBe(2);
    expect(pointsToGrade(4, 24)).toBe(2);
    expect(pointsToGrade(3, 24)).toBe(1.5);
    expect(pointsToGrade(2, 24)).toBe(1.5);
    expect(pointsToGrade(1, 24)).toBe(1);
    expect(pointsToGrade(0, 24)).toBe(1);
  });
});
