
Learn to apply test driven development with Flutter by building a small app using a fake HTTP server and mock API, exploring clean architecture, user endpoints, and Firebase testing.
Create a user entity within a flutter app by structuring layers and features, defining a domain user with id, created at, name, and avatar, and exploring referential equality in Dart.
Discover how Dart differentiates referential and value equality, and learn to override the equality operator and hashCode to implement value-based comparisons using Equatable.
Learn to implement value equality with Equatable, define an authentication repository contract, and use the dartz Either type to model server failures in clean architecture.
Discover how dart's either patterns with left and right express failure or success, implement future either in repositories, and model API and cache failures across domain and data layers.
Explore domain layer use cases in clean architecture by implementing a create user use case with a params type and Equatable, handling fields like created at, name, and avatar.
Define a user data blueprint with id, created at, name, and avatar. The domain layer get_user use case fetches users via the repository, handling success or failure.
Learn to unit test flutter use cases with clean architecture by validating contracts and interfaces, and by mocking dependencies to avoid real server calls.
Explore test driven development with clean architecture in Flutter by creating tests with the Flutter test package that mock the authentication repository using mocktail, arranging, acting, and asserting outcomes.
Learn how to stub and hijack dependencies in tests for a Dart and Flutter clean architecture setup, using then, then answer, and right/left in an asynchronous create user flow.
Act, then await the future, and assert the result. Verify the auth repositories create user method is invoked and the outcome equals a right void.
Demonstrate test-driven development with clean architecture by validating part 4 tests that verify the use case calls the president exactly once, with creator, name, and avatar, and no further interactions.
Practice flutter test driven development with clean architecture by creating and running tests, validating calls with Createdat, and mocking the auth repository using mocktail for get user scenarios.
Learn to test the get_users use case by mocking the authentication repository and returning a list of users. Verify the repository get_users is called once and no extra interactions occur.
Define the data layer user model by extending the user entity, and implement from map, from json, to map, and to json serialization with a copyWith method for immutable updates.
Demonstrates the copyWith method to create a new user model with updated fields using nullable parameters to preserve existing values.
Demonstrate test driven development in Flutter with clean architecture by unit testing the user model, using mocktail for dependencies, and confirming it is a subclass of the user entity.
Demonstrates reading a user json fixture in a test-driven workflow for Flutter clean architecture, validating a user model from a json map using fixtures and json parsing.
Learn to implement and test json serialization with fromJson, toJson, fromMap, and toMap in Flutter, using a generic fixture reader to decode json fixtures into model maps.
Explore the data layer and remote data source in flutter clean architecture, implementing a repository implementation and authentication repository with interfaces, dependency inversion, and handling either failure.
Inject the remote data source to implement the auth repository, apply dependency inversion and test driven development, ensuring the create user method calls the remote data source and handles exceptions.
Implement an authentication repository with a mock remote data source, write tests for create user, and verify success and error handling in a clean architecture setup.
Explore tests for a Flutter authentication repository implementation, validating correct create user calls to a remote data source, and handling server failures with custom exceptions.
Define and implement a custom server and API exception using Equatable, pass status codes, and map remote data source errors to left API failures in authentication repository tests.
Learn to convert API exceptions into API failures, implement repository logic for get users, and drive development with tests that verify remote data source interactions and error handling.
Test the authentication remote data source implementation, validating success with 200/201 status codes and failures with proper exceptions, and add a dedicated dart test file using the http package.
Learn how to scaffold a http client dependency, mock it, and test the authentication remote data source in a Flutter and Dart clean architecture setup.
Test flutter http post requests with tdd, validating 200, 201, and 400 responses using a mock API; verify URL, endpoint, and JSON body.
Write a Flutter http get request test that handles Dart errors with api exceptions, uses Uri for endpoints, and decodes json responses into a list of user models via fromMap.
Learn to throw an api exception for non-200 http responses and validate endpoint calls in a remote data source to pass tests and reach green phase.
Explore how the presentation layer uses block or qubit in Flutter, with authentication events, loading states, and use cases to support create user and get users in clean architecture.
Explore Cubit versus Bloc patterns by folding an either result into failure messages and success states, then implement a Cubit for get users and compare to Bloc.
Learn to write a cubit authentication test by mocking get users and create user use cases, wiring them into the cubit's setup and verifying the authentication initial state.
Learn to test a qubit using the block test package to mock the create user use case, set up dev dependencies, and verify emitted states creating user and user created.
Create a test for a Cubit create user failure, asserting emitted states: creating user and authentication error from a server API failure.
Master cubit based tests for get users, covering successful loading and authentication error scenarios, and verifying interactions and emitted states.
Explore implementing dependency injection with get_it in a clean architecture Flutter app, wiring the domain, data, and presentation layers through a service locator.
Explore how to configure GetIt service locator for authentication use cases, wiring concrete repositories, data sources, and http client across abstract and concrete classes from data to presentation layers.
Explore building a Flutter app with dependency injection, a bloc-like qubit using a service locator, and a home UI with add-user flow and loading states.
Create the first user in a Flutter app by adding a username input and a create user button, then save and show the new user (avatar included) in the list.
In this course, we will cover how to do test driven development. We will also build a dummy app to learn about it in depth. We will cover almost 100 tests which will involve api mock testing, firebase api mock testing, build correct http response, learn how to deal with incorrect or wrong response from the server.
What is Test Driven Development (TDD)?
In layman’s terms, Test Driven Development (TDD) is a software development practice that focuses on creating unit test cases before developing the actual code. It is an iterative approach combining programming, unit test creation, and refactoring.
The TDD approach originates from the Agile manifesto principles and Extreme programming.
As the name suggests, the test process drives software development.
Moreover, it’s a structuring practice that enables developers and testers to obtain optimized code that proves resilient in the long term.
In TDD, developers create small test cases for every feature based on their initial understanding. The primary intention of this technique is to modify or write new code only if the tests fail. This prevents duplication of test scripts.
Apart from that you will learn correct folder structure of your using BLoC and Provider with clean architecture aspect.
Throughout the testing we will use BLoC & Cubit and show how to manage states during testings.
We will cover how to use the flutter_test package and all the functions in like
1. test()
2. when()
3. expect()
4. verify()
5. verifyNoMoreInteractions()