Skip to content

Instantly share code, notes, and snippets.

public class LogAnalyzer {
private IExtensionManager manager;
public LogAnalyzer(IExtensionManager mgr) {
manager = mgr;
}
public bool isValidLogFileName(string fileName) {
return manager.isValid(fileName);
}
}
public bool isValidLogFileName(string fileName) {
FileExtensionManager manager = new FileExtensionManager();
return manager.isValid(fileName);
}
class FileExtensionManager {
public bool isValid(string fileName) {
//TODO: read some file here
}
}
public class HomeworkCentral {
private final Homework homework;
public HomeworkCentral(Homework homework) {
this.homework = homework;
}
void doHomework() {
homework.complete();
private static IContainer MiddleCompany()
{
ContainerBuilder builder = new ContainerBuilder();
//在仲介公司裡寫需求人申請單
builder.RegisterType<MineWithMiddle>();
//小明所需打掃阿姨需求
builder.RegisterType<Aunt>().As<ISwapable>();
return builder.Build();
// 一開始找清潔阿姨前,範例
public class Mine
{
public Aunt aunt = new Aunt();
public void Room()
{
aunt.Swapping();
}
}
public class Calculator
{
public int Add(int x, int y)
{
return x + y;
}
}
[TestClass]
public class UnitTest1
[TestMethod]
public void Test_Charge_Customer_Count()
{
//arrange
ICheckInFee stubCheckInFee = MockRepository.GenerateStub<ICheckInFee>();
Pub target = new Pub(stubCheckInFee);
stubCheckInFee.Stub(x => x.GetFee(Arg<Customer>.Is.Anything)).Return(100);
var customers = new List<Customer>
hello.o: file format Mach-O 64-bit x86-64
RELOCATION RECORDS FOR [__text]:
0000000000000068 X86_64_RELOC_BRANCH _func
0000000000000032 X86_64_RELOC_SIGNED _gy
000000000000002c X86_64_RELOC_SIGNED _gx
0000000000000018 X86_64_RELOC_SIGNED _gy
000000000000000f X86_64_RELOC_SIGNED _gx
cffa edfe 0700 0001 0300 0000 0100 0000
0400 0000 0802 0000 0020 0000 0000 0000
1900 0000 8801 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
3001 0000 0000 0000 2802 0000 0000 0000
3001 0000 0000 0000 0700 0000 0700 0000
0400 0000 0000 0000 5f5f 7465 7874 0000
0000 0000 0000 0000 5f5f 5445 5854 0000
0000 0000 0000 0000 0000 0000 0000 0000
7900 0000 0000 0000 2802 0000 0400 0000
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 10, 14 sdk_version 10, 14
.globl _func ## -- Begin function func
.p2align 4, 0x90
_func: ## @func
.cfi_startproc
## %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16