Skip to content

Duong's Blog

About technology stuff that piqued my interest

  • English
  • Vietnamese
  • About me

Tag: testing

  • Home
  • testing

Kluent – FluentAssertions cho Kotlin

November 13, 2022November 17, 2022 duongnt.bk1 Comment on Kluent – FluentAssertions cho Kotlin

Unit test không chỉ cần đúng mà còn phải dễ đọc. Với Kluent, chúng ta có viết những assertion nghe giống như ngôn ngữ tự nhiên.

Java/Kotlin, Vietnamese Kluent, Kotlin, testing

Kluent – FluentAssertions for Kotlin

November 13, 2022November 17, 2022 duongnt.bk1 Comment on Kluent – FluentAssertions for Kotlin

A unit test not only needs to be correct but also needs to be readable. With Kluent, we can write assertions that sound like natural language.

English, Java/Kotlin Kluent, Kotlin, testing

Mock IHttpClientFactory để chạy unit test

August 24, 2022August 24, 2022 duongnt.bkLeave a Comment on Mock IHttpClientFactory để chạy unit test

Viết unit test cho interface IHttpClientFactory không phải là việc đơn giản. Hôm nay, chúng ta sẽ tìm hiểu 2 phương án giải quyết bài toán này.

C#, Vietnamese fakeiteasy, ihttpclientfactory, testing

Mock IHttpClientFactory for unit testing

August 24, 2022August 24, 2022 duongnt.bk1 Comment on Mock IHttpClientFactory for unit testing

Writing unit tests for the IHttpClientFactory interface is not that straightforward. Today, we will explore two different ways to solve this problem.

C#, English fakeiteasy, ihttpclientfactory, testing

Nhược điểm của Ignored trong FakeItEasy

August 8, 2022August 8, 2022 duongnt.bk1 Comment on Nhược điểm của Ignored trong FakeItEasy

FakeItEasy là thư viện tôi hay dùng để tạo mock object. Nhưng property Ignored của nó có thể gây hại nếu ta không cẩn thận.

C#, Vietnamese bug, fakeiteasy, testing

FakeItEasy Ignored might be harmful

August 8, 2022August 8, 2022 duongnt.bkLeave a Comment on FakeItEasy Ignored might be harmful

FakeItEasy is my favorite library to create mock objects for unit tests in C#. One of its features, the `Ignored` property, can be harmful if used improperly.

C#, English bug, fakeiteasy, testing

Điều khiển thời gian trong unit test C#

March 23, 2022December 6, 2022 duongnt.bk1 Comment on Điều khiển thời gian trong unit test C#

Việc test các hàm phụ thuộc vào thời gian chạy là tương đối phức tạp. Thật may là các package NodaTime và NodaTime.Testing có thể giúp ta giải quyết vấn đề này.

C#, Vietnamese C#, NodaTime, testing

Time dependent unit testing in C#

March 23, 2022December 6, 2022 duongnt.bk1 Comment on Time dependent unit testing in C#

Testing time dependent classes can be tricky. Fortunately, the NodaTime and NodaTime.Testing package can assist us in resolving this issue.

C#, English C#, NodaTime, testing
Copyright © 2025 Duong's Blog All rights reserved. Theme: Flash by ThemeGrill. Powered by WordPress