Skip to content

Duong's Blog

About technology stuff that piqued my interest

  • English
  • Vietnamese
  • About me

How does AutoFixture create test data?

September 7, 2022September 7, 2022 duongnt.bk1 Comment on How does AutoFixture create test data?

I frequently use the AutoFixture library to generate test data for my unit tests. Today, we will checkout the way it generates bool, enum, and int type.

C#, English AutoFixture, C#, random

AutoFixture tạo test data như thế nào?

September 7, 2022September 7, 2022 duongnt.bkLeave a Comment on AutoFixture tạo test data như thế nào?

Tôi thường xuyên sử dụng thư viện AutoFixture để tạo dữ liệu test cho unit test. Hôm nay, chúng ta sẽ tìm hiểu cách nó sinh dữ liệu.

C#, Vietnamese AutoFixture, C#, random

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

Xử lý lỗi codecs với register_error

July 25, 2022July 25, 2022 duongnt.bkLeave a Comment on Xử lý lỗi codecs với register_error

Trong Python có sẵn một số handler để xử lý lỗi encode. Hơn thế nữa, ta còn có thể tự thêm hàm handler của mình vào module codecs bằng hàm register_error.

Python, Vietnamese encoding, python

Codecs error handling with register_error

July 25, 2022July 25, 2022 duongnt.bk1 Comment on Codecs error handling with register_error

Python supports built-in handlers to cope with encoding errors. Not only that, we can also define our own handlers and register them with the codecs module.

English, Python encoding, python

Tên trường của ValueTuple trong C#

July 11, 2022July 11, 2022 duongnt.bkLeave a Comment on Tên trường của ValueTuple trong C#

Đặt tên cho trường trong ValueTuple không phải là một tính năng đột phá của C#. Nhưng các bạn đã bao giờ tự hỏi chức năng đó hoặt động như thế nào?

C#, Vietnamese C#, ValueTuple

All about ValueTuple field names in C#

July 11, 2022July 11, 2022 duongnt.bk1 Comment on All about ValueTuple field names in C#

Naming fields in ValueTuple is not a ground-breaking feature. After all, it is just syntactic sugar. But have you ever wondered how that feature is implemented?

C#, English C#, ValueTuple

Posts navigation

Older posts
Newer posts
Copyright © 2025 Duong's Blog All rights reserved. Theme: Flash by ThemeGrill. Powered by WordPress