Skip to content

Instantly share code, notes, and snippets.

View passsy's full-sized avatar

Pascal Welsch passsy

View GitHub Profile
import 'package:flutter_test/flutter_test.dart';
void main() {
test('1 should round 0.145 to 0.15', () {
const value = 0.145;
final rounded = value.toStringAsFixed(2);
expect(rounded, '0.15'); // actual 0.14
});
test('2 should round 0.145 to 0.15', () {
@passsy
passsy / LastCall.java
Last active February 13, 2017 14:35 — forked from sockeqwe/LastCall.java
Mockito verification of the last call on a method (targeting org.mockito:mockito-core:2.7.5)
package com.pascalwelsch.mockito;
import org.mockito.exceptions.base.MockitoException;
import org.mockito.exceptions.verification.ArgumentsAreDifferent;
import org.mockito.internal.debugging.LocationImpl;
import org.mockito.internal.junit.JUnitTool;
import org.mockito.internal.reporting.SmartPrinter;
import org.mockito.internal.verification.VerificationModeFactory;
import org.mockito.internal.verification.api.VerificationData;
import org.mockito.internal.verification.argumentmatching.ArgumentMatchingTool;