Пример #1
0
 public void GetGamesByName_Test()
 {
     string filename = Path.GetTempFileName();
     IGameDatabase database = new GameDatabase(filename);
     var fakeGameInfo = new Mock<IGameInfo>();
     fakeGameInfo.SetupGet(game => game.Name).Returns("TestGame");
     fakeGameInfo.SetupGet(game => game.UUID).Returns("TESTGAME");
     fakeGameInfo.SetupGet(game => game.PlatformID).Returns("TESTPLATFORM");
     database.AddGame(fakeGameInfo.Object);
     Assert.Equal(fakeGameInfo.Object.UUID, database.GetGamesByName("TestGame")[0].UUID);
     Assert.Equal(fakeGameInfo.Object.Name, database.GetGamesByName("TestGame")[0].Name);
     Assert.Equal(fakeGameInfo.Object.PlatformID, database.GetGamesByName("TestGame")[0].PlatformID);
     this.DisposeSqlite();
     File.Delete(filename);
 }