Notes on software and the ideas behind it
Find the meaning
behind the code.
I’m Fred Yang. I write about software—how it works, why it behaves the way it does, and the ideas that make code easier to reason about.
Open the notebookWorking notes / 2026
Recently mapped
Architecture, reactivity, and the hidden relationships that shape frontend systems.
Unit Test
Refactory to break dependency
Extract an interface to allow replacing underlying implementation Inject stub implementation into a class under test Receiving an interface at the constructor level. If your code under test requires more than one stub to...
Follow the thread
WF
Cancel Hanlder
The cancel handler view provides a way to define activity cancellation logic. A cancel handler has some similarities to the fault handlers just discussed. Like fault handlers, they are attached only to a composite...
Follow the thread
WF
ActivityExecutionContext
It is a container of services that is availabe to activities ruing their execution. This set of service is the same for all activities in all WF program instances. Some services are provided by...
Follow the thread
asp.net mvc
Test asp.net mvc route
//arrange
RouteCollection routes = new RouteCollection();
MvcApplication.RegisterRoutes(routes);
var httpContextMock = new Mock<HttpContextBase>();
httpContextMock.Expect(c => c.Request.AppRelativeCurrentExecutionFilePath).Return("~/product/list");
Follow the thread
asp.net mvc
mvc routing
Routing is actually not part of the asp.net mvc component. But mvc depends on this asp.net components. To add a route to the route table, you can use the following code.
Follow the thread