public void WhenTransformationReturnsScreen_UpdatesScreen() { var screen = new FakeScreen(); var app = _app.UpdateScreen((FakeScreen _) => screen); app.CurrentScreen.Should().Be(screen); }
protected override void given_the_context_of() { base.given_the_context_of(); _screenConductor = (Conductor<IScreen>.Collection.OneActive)_screen; _activeScreen = new FakeScreen(); }
public void GivenScreen_MakesScreenCurrent() { var screen = new FakeScreen(); var app = _app.OpenScreen(screen); app.CurrentScreen.Should().BeSameAs(screen); }
public void GivenInitialScreen_InitialisesProperty() { var screen = new FakeScreen(); var app = new WordTutorApplication(screen); app.CurrentScreen.Should().BeSameAs(screen); }
protected override void given_the_context_of() { base.given_the_context_of(); ScreenConductor = (Conductor <IScreen> .Collection.OneActive)Screen; activeScreen = new FakeScreen(); }
protected override void given_the_context_of() { base.given_the_context_of(); activeScreen = new FakeScreen(); ScreenConductor = (Conductor <IScreen>)Screen; }
public void WhenCalled_RevealsPriorScreen() { var screen = new FakeScreen(); var current = _app.CurrentScreen; var app = _app.OpenScreen(screen).CloseScreen(); app.CurrentScreen.Should().Be(current); }
public void WhenTransformationReturnsScreen_PriorScreenIsUnchanged() { var alpha = new FakeScreen(); var beta = new FakeScreen(); var current = _app.CurrentScreen; var app = _app.OpenScreen(alpha) .UpdateScreen((FakeScreen _) => beta) .CloseScreen(); app.CurrentScreen.Should().Be(current); }
public void FakeScreenWritesWhereItsSupposedTo() { var fakeScreen = new FakeScreen(); fakeScreen.Write(10, 10, "Hello", ConsoleColor.Blue); Assert.Equal(fakeScreen[14, 10].Char, 'o'); Assert.Equal(fakeScreen[14, 10].Color, ConsoleColor.Blue); fakeScreen.Clear(); Assert.Equal(fakeScreen[14, 10].Char, ' '); Assert.Equal(fakeScreen[14, 10].Color, ConsoleColor.White); }
public void test1() { var fakeScreen = new FakeScreen(); var text = new Text(); // text.WriteText("O", "red", ConsoleColor.Red, fakeScreen); // Assert.Equal(fakeScreen[10, 10].Char, ''); // Console.Write(text.WriteText("O", "red", null)); // fakeScreen.Write(10, 10, "Hello", ConsoleColor.Blue); // Assert.Equal(fakeScreen[14, 10].Char, 'o'); // Assert.Equal(fakeScreen[14, 10].Color, ConsoleColor.Blue); // fakeScreen.Clear(); // Assert.Equal(fakeScreen[14, 10].Char, ' '); // Assert.Equal(fakeScreen[14, 10].Color, ConsoleColor.White); }
public void CharacterWritesCorrectly() { var screen = new FakeScreen(); screen.Clear(); screen.Write(10, 10, "* * * * * * * * * * * * * * *"); screen.Write(10, 11, " * * * * * * * * * * * * * * * "); screen.Write(10, 12, "* * * * * * * * * * * * * * * * * * * * * * * * *"); screen.Write(10, 13, " * * * * * * * * * * * * * * * "); screen.Write(10, 14, "* * * * * * * * * * * * * * *"); //Console.ReadKey(true); Console.WriteLine(screen[10, 10].Char); Assert.Equal(2, 2); }