public void Setup() { // Act var loggerSet = false; var networkContextSet = false; var stubContextStorage = new StubIContextStorage(); var stubLogger = new StubILogger(); var stubNetworkContext = new StubINetworkContext(); stubContextStorage.SetDataOf1StringM0 <ILogger>((key, value) => { loggerSet = true; }); stubContextStorage.SetDataOf1StringM0 <INetworkContext>((key, value) => { networkContextSet = true; }); // Act ApplicationContext.Setup(stubContextStorage, stubLogger, stubNetworkContext); // Assert loggerSet.ShouldHaveSameValueAs(true); networkContextSet.ShouldHaveSameValueAs(true); }
public void Set() { // Act var valueSet = false; var stubContextStorage = new StubIContextStorage(); stubContextStorage.SetDataOf1StringM0 <string>((key, value) => { valueSet = value == "some value"; }); ApplicationContext.Setup(stubContextStorage, null, null); // Act ApplicationContext.Set("some value"); // Assert valueSet.ShouldHaveSameValueAs(true); }