My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using NUnit.Framework;

namespace Konstruktor.Tests
{
[TestFixture]
sealed class ConstructorArguments
{
sealed class I2
{}

sealed class Instance
{
public readonly string Str;
public readonly string Str2;

public Instance(string str, I2 i2, string str2)
{
Str = str;
Str2 = str2;
}
}


[Test]
public void test()
{
var b = new Builder();
b.constructorArgument<Instance, string>(0, s => "S1");
b.constructorArgument<Instance, string>(2, s => "S2");


using (var scope = b.beginScope())
{
var i = scope.resolve<Instance>();

Assert.AreEqual("S1", i.Str);
Assert.AreEqual("S2", i.Str2);
}
}
}
}

Change log

r8 by paramatrix on Mar 26, 2010   Diff
renamed scope() to beginScope() and
createNestedScope() to beginNestedScope()
Go to: 
Project members, sign in to write a code review

Older revisions

r2 by paramatrix on Mar 25, 2010   Diff
initial checkin after isolation from
dependent projects
All revisions of this file

File info

Size: 712 bytes, 41 lines
Powered by Google Project Hosting