public async Task TestLoadBoardFailures() { var repository = BoardStreamRepositoryTest.SetupBoardStreamRepository(new byte[] { 1, 2 }); await AssertExtensions.ThrowsExceptionAsync <Exception>( async() => await repository.LoadAsync("DummyBoardName")); }
public async Task TestLoadBoardFailures() { // Prepare var repository = BoardStreamRepositoryTest.SetupBoardStreamRepository(new byte[] { 1, 2 }); // Execute await repository.LoadAsync("DummyBoardName"); }
public async Task TestSaveBoard() { var buffer = new byte[9 * 9]; var repository = BoardStreamRepositoryTest.SetupBoardStreamRepository(buffer); await repository.SaveAsync("DummyBoardName", (Board)BoardSampleData.sampleBoard); Assert.IsTrue(BoardSampleData.sampleBoard.SequenceEqual(buffer)); }
public async Task TestSaveBoard() { // Prepare var buffer = new byte[9 * 9]; var repository = BoardStreamRepositoryTest.SetupBoardStreamRepository(buffer); // Execute await repository.SaveAsync("DummyBoardName", (Board)BoardSampleData.sampleBoard); // Assert CollectionAssert.AreEqual(BoardSampleData.sampleBoard, buffer); }
public async Task TestLoadBoard() { // A BoardStreamRepository needs an IStreamManager. Note that we use a // stub generated by Microsoft Fakes here. // Prepare var repository = BoardStreamRepositoryTest.SetupBoardStreamRepository(BoardSampleData.sampleBoard); // Execute var board = await repository.LoadAsync("DummyBoardName"); // Assert CollectionAssert.AreEqual(BoardSampleData.sampleBoard, (byte[])board); }