35 lines
980 B
Dart
35 lines
980 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:garden_planner/api/api_entities/beet_entry.dart';
|
|
|
|
void main() {
|
|
test('BeetEntry entity Test', () {
|
|
// Arrange
|
|
const int plantId = 1;
|
|
const int position = 2;
|
|
const int beetrow = 3;
|
|
// Act
|
|
final beetEntry = BeetEntry(plantId, position, beetrow);
|
|
// Assert
|
|
expect(beetEntry.plantId, equals(plantId));
|
|
expect(beetEntry.position, equals(position));
|
|
expect(beetEntry.beetRow, equals(beetrow));
|
|
});
|
|
|
|
test('BeetEntry entity toJson() should work', () {
|
|
// Arrange
|
|
const int plantId = 1;
|
|
const int position = 2;
|
|
const int beetrow = 3;
|
|
// Act
|
|
final beetEntry = BeetEntry(plantId, position, beetrow);
|
|
// Act
|
|
final jsonMap = beetEntry.toJson();
|
|
|
|
// Assert
|
|
expect(jsonMap, isA<Map<String, dynamic>>());
|
|
expect(jsonMap['plantId'], equals(1));
|
|
expect(jsonMap['position'], equals(2));
|
|
expect(jsonMap['beet_row'], equals(3));
|
|
});
|
|
}
|