public void ShouldReturnTheCurrentContextIfRoleIsSameAsContextRole() { // Arrange var stack = new Stack(); stack.Push(this); ContextAssertionTest = this; Context.Initialize.With(() => stack); // Act var current = Context.Current<TheCurrentAsMethod>(this, c => c.ContextAssertionTest); // Assert current.Should().Equal(this); }
public void ShouldReturnTheCurrentContextIfRoleIsSameAsContextRole() { // Arrange var stack = new Stack(); stack.Push(this); ContextAssertionTest = this; Context.Initialize.With(() => stack); // Act var current = Context.Current <TheCurrentAsMethod>(this, c => c.ContextAssertionTest); // Assert current.Should().Equal(this); }
public void ShouldThrowExceptionIfRoleIsntSameAsContextRole() { // Arrange const string s = "AnotherRole"; var stack = new Stack(); stack.Push(this); ContextAssertionTest = this; Context.Initialize.With(() => stack); // Act var current = Context.Current <TheCurrentAsMethod>(s, c => c.ContextAssertionTest); // Assert current.Should().Equal(this); }
public void ShouldThrowExceptionIfRoleIsntSameAsContextRole() { // Arrange const string s = "AnotherRole"; var stack = new Stack(); stack.Push(this); ContextAssertionTest = this; Context.Initialize.With(() => stack); // Act var current = Context.Current<TheCurrentAsMethod>(s, c => c.ContextAssertionTest); // Assert current.Should().Equal(this); }