A guide to testing and mocking in Rust

Daniel Bunte
6 min readAug 12, 2022
Using new technology, it can be challenging to do things the right way. Don’t throw in the towel, just yet.
Photo by Dmitry Ratushny on Unsplash

Coming from an enterprise-grade language like Kotlin, Java, or C# to Rust requires a bit of learning 📈. There are so many things that I absolutely love about Rust, compared to other languages. Rust, for instance, brings its own testing framework out of the box!

However, if you’ve used well-established testing libraries like JUnit, MockK, Mockito, and alike, you will quickly find that writing…

--

--

Daniel Bunte

Leader, self-taught developer with interests in Architecture/Automation/Security.