예제 #1
0
 public void GetGameByUUID_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.GetGameByUUID("TESTGAME").UUID);
     Assert.Equal(fakeGameInfo.Object.Name, database.GetGameByUUID("TESTGAME").Name);
     Assert.Equal(fakeGameInfo.Object.PlatformID, database.GetGameByUUID("TESTGAME").PlatformID);
     this.DisposeSqlite();
     File.Delete(filename);
 }