Основные методы
Основные методы
Основные методы
Основные методы
public void ArrangeMocks_MocksCreatedAndArranged() { var container = new UnityContainer(); string result = null; container.Arrange <ILogger>(x => x.Log(Arg.AnyString)).DoInstead((string msg) => result = msg).MustBeCalled(); container.ArrangeLike <IMessage>(x => x.Message == "foo"); container.ArrangeLike <ICounter>(x => x.Next == 5); var greeter = container.RegisterType <Greeter>().Resolve <Greeter>(); greeter.Greet(); Assert.AreEqual("5: foo", result); }