2011-02-09 19:28:33 +00:00
using System ;
2011-02-12 23:53:43 +00:00
using NHibernate ;
2011-02-09 19:28:33 +00:00
using NHibernate.Cfg ;
2011-02-09 00:05:32 +00:00
using NHibernate.Tool.hbm2ddl ;
using NUnit.Framework ;
2011-02-09 03:41:35 +00:00
using Portoa.NHibernate ;
2011-02-09 00:05:32 +00:00
namespace VideoGameQuotes.Api.Tests.NHibernate {
2011-02-09 03:41:35 +00:00
[TestFixture, Ignore]
2011-02-09 00:05:32 +00:00
public class SchemaExporter {
[Test]
public void Export_schema ( ) {
2011-02-09 03:41:35 +00:00
new SchemaExport ( GetConfig ( ) )
. SetDelimiter ( ";" )
. SetOutputFile ( @"c:\users\tmont\code\VideoGameQuotes\Tests\VideoGameQuotes.Api.Tests\NHibernate\schema.sql" )
. Execute ( false , true , false ) ;
}
private Configuration GetConfig ( ) {
return new Configuration ( ) . Configure ( GetType ( ) . Assembly , GetType ( ) . Namespace + ".hibernate.cfg.xml" ) ;
}
[Test]
2011-02-09 19:28:33 +00:00
public void Create_initial_data ( ) {
2011-02-09 03:41:35 +00:00
var config = GetConfig ( ) ;
var admin = new User {
Username = "admin" ,
Group = UserGroup . Admin
} ;
admin . ChangePassword ( "password" ) ;
var session = config . BuildSessionFactory ( ) . OpenSession ( ) ;
using ( var tx = session . BeginTransaction ( ) ) {
new NHibernateRepository < User > ( session ) . Save ( admin ) ;
tx . Commit ( ) ;
}
2011-02-09 19:28:33 +00:00
2011-02-12 23:53:43 +00:00
CreateInitialData ( session , admin ) ;
}
2011-02-27 08:47:16 +00:00
private static byte [ ] GetSystemIcon ( string name ) {
string base64String = null ;
#region icon base64 encoded data
switch ( name ) {
case "360" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACe0lEQVR4nMWSy0tUcQCFv9+d+5o7OuNcHZvRGR8tyrIWWSomKRaF2YMe0KCILVoURv9B0HsXtUlTsxcpZUVQ4EKwkKJFQZFktLTSIJ10tLA7zePeNi6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FggFQtGMIqc1rVrTpjXtWhNrTYdSdCrFOWs5C4EfQfD1/QIPFntJaUFOf2Z+9hf++SY6xzJY4+ELODi0lA4F1y4o3n7UXA8V0TNavAiymVaPidEioS5yv/CFnXf7vHxRZnXpG0srPzho3mVu8w+P1xxvvic8en2GT7EigqwfQtB15S+T3fvcuZUl3yOxKTwJS9WZvJToKty9XWawzzF64zdT5Qr9PZIAsuIhqPFufJGrbpOp0asRwAD2iAK4BNa20f4GLAfbTNaPvWMl7li4XmCBDViuP9LlWqYRGGC3wcxJxD8HtLlBUgFk6AAAAABJRU5ErkJggg==" ;
break ;
case "nes" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABoklEQVR4nNWSu24TQQBFz8zO7MMCP+LYIibgBgRloKfiCxASCIREixAfwa8gIT6AhjJAUJQoEbQkDbISO2sTE1Cc3fXOYylA9LiC05/T3Av/PQKIgN6C/khcuXrt/cNHj2/9av0NFa9evtgQd+7eP2q2WhfyPKPyFb6qEELS6vRwzuGdw5g5Z6c/EEKAEAghqNcbnByPUxVFoT4YfEEGAVLFfJ+mgCCbO6yzOGsp5wVMRvTmBU4GpHHCtNNlpbusVS2Jw7wocJXE2hn18w3S0SGr8ZQK0NYwkQFlo8lYKWxVoQNFaQxJHIWqliR6Mk5pttpkWYYpZnjvuf3gHtZ6DodDbi61ab55zfU84yCpsVzmPPeCJI61iqIoTI9GzGanrF7q8+njLq3WEjs7u3jvcd6zv79Hr3+ZvN1mmOV0azXMuw2iKArFk6fPqrW1G5iyREhJICVxnNBduYj8PUxZlpx8O8Y5/ycaBIrtrU3U+vrbwVnh+lJKlFKEWqO1Ivy8R6g1QgiMtVhjMdZijMFYi3Oe7c0PAwGcAzoLHunrgt6/xE8pa71m6+aXmgAAAABJRU5ErkJggg==" ;
break ;
case "n64" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADCklEQVR4nG2TX2hbdRTHP/fm3uTeum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udW00f13RpXj3YPnjGChl0djcz8yVF4AtymQqLCyWymRKZ9AqgiDsh3pku/Fnj1MCJplfvnlvSDjUf0zDZt7+V/iPdNLaEQUEQ+ES2mEQdEz8I0KTOh3id95e7mDqZxNliY4eaj+ko2hSKty++M/c1zc9UgbARxw98auUAUIDi6PIkhXGTh7c1Ys+WGUspULTpAs1xvTKoCJkfNUK6jdNgk18qMJsdR6mAHYle5mIGrpeg42YepQIqXhGB5siQEbV0aeAFLpomaWq1GRo+xM6uBqrVKu6ay6UrT7j2+AVGe42AOjW/iiEtwkbMklJI3zKj6MIklX/DQuY3k1+mmJ6ZRUrpCSm99FyE+ddRiquCVP4NujSxzAhCCF9365VsxS221H2X+dzky0R06+HxpyGJkiyVU3cA7o+eHh59FGVl7Wcwn5t81RzpPur5Ndx6eVGEDPteW/zAUCA8vucmzgIlQ7MGPb82C+rGem8XDM3s9Hz3AWDvaugfFcrg1+rH+wB7nFjrWNiyRwBtE/lrYcsecWItj4E9m9j/Y/4CVTv68jWErNkAAAAASUVORK5CYII=" ;
break ;
case "gba" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACHElEQVR4nNWSO09TYQCGn++c71zoDYSDQA9FLt5NHNDFReOkjqirg78A3Z1dwZi4+hMcHUw00UElxmiixKgotrS0tkdOW9rS79wcLJs/QJ/kzbs8eacX/nvEoHXgCHA+lxs5axjmEIAQf5RkICqleq3WzhvgOfAFiARwafHMuYeOMzFVLH7D834ShSFC09A0DYA4jkmSGCkNxp1JDs0u0KjXttfWXtwUhZm5p16jfjEMFWEYYaWznLpwmS4CpenshTHdbhe120Otv8QeCun4fWw7xeRk/pmU0pifm5/l1vIyq6v32PTajN64Rc626AtBJ4zxO32aDZ/g7kd6zTqjYw6OM04Si3kJOO12h+1qlXZ7l0jXeNJSpPowbOoIIWgh6GbTGIZk6eo1SGKEELx/98GRui4t399hZfU+owdG0FRCxjY5OZLicM5GABvtPdZ9CKVk7fUrWq02cZzg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dr9xh0HFy346qNulVxHJvURAqA3zfKhIOj6JpJu90GQNd12h2bWn2Ltnt/iP1en0bdqqiWVSvWalVM00BKidtxsZ0WQghuFm4CkJnKIKWk2+3S73cRQmDbDpZVK6pSDq4VCr8wnc2y9UcNIRSkhGHPMKPRGCD4rbzOdncbIUDKAaORMIVCHikH11Rgee36qpOemDCuXL3C95cuLjWs2g+9XvcuYP9V31RVTzwQCj++76mFQ88uLrB2fdUBlgHw+wOnT757SkbjyRv/cbAd54vGk4WT752Sfn/g9INEZiy9qwoc/x/z3zieuq/NAPwJaks8AbN544kAAAAASUVORK5CYII=" ;
break ;
case "wii" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNElEQVR4nJWRTU7DMBCFP3sSh1aVijgAEseiKxAViy44DAukXqAsEJwAdY3EAbhGHPoTJ7HNohUbbInO8vnpe288isRMp+eP17PZwhgjAH3X+dXz6snW9UPK/2fm83v39fEZrbXRWhvruo43t3cu5dUpsSwLfXF1SdN8Y21z1MqkNykCaK1xrkOLpm3bbNsswBjDZDJGKcVoNMoCiuwLMHhPCAGAGMNpgBgjxhgU0DqH9ycCbNOwaXtc38PQ/Tb5FyBG0FrA7zEKzGRCzAQlASEG+mEgBH8wieSKpgFKKUSE8fH3RQSVAWTPWIgQQqB17vQGh1RNURRARCSbk19hFzWlCFprgg+ozA5J9GazDdNScF1P1w9UVcV2u0veMdng7fVlWdf1ojqrRAH7fevX6/dlyvsDnXZ/3QyT7JMAAAAASUVORK5CYII=" ;
break ;
case "ps2" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACIElEQVR4nM2SSU8TARiGn9k6M51pO7S1VELjHhKKSYmyRCN6kIP/wJM3o0cO3ky8+Qe8+gu869GzJiQsgSiIElK1hZbaZTozXWbxAgmRBK881/f93sv3wHkjCShn5PJR5xTSSCb3ae7ew6g0c7cXU7XX/xYUJfaydPuOO7+wGGVzF1eB2PEigig+K83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AASUVORK5CYII=" ;
break ;
case "gb" :
base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB40lEQVQ4jaXTv2pUQRTH8e+dvXuzJpAs0WAEkyxIdLER30AIgo0R9VF8ASt9Dm1sUlhY2Goh2IhGgiGignETE8hu1uz9MzPnzFgYYorcNBmYYg7Mhx8/OAmQcIaTHn8479NBv78KjEcghoCq4kVw1jLKC/m5+at7/95dORGIMaYbX79337x9R2dhnggYkxAjbG3v0OlcJm0kLWB0IgCYPC9IjGF5+Q6iepRgZeUVZVEyMdE6BYgRDQEAL4L3Hi+CqpIkoCEQQmjVdgCYoAoxYp3De084BIkgIohqVgtEMCFEyqpibW39eDfkRcH4xDQmMWk9ECNzc5cYDofs7uwezRuNBlcXO0xPt+n1tk9JEIKZnb1INpb9K897nHOIKCKKdR4vUp9AVNnsbfHs+QtmZs5ze+kWIkI1GiF7vzn37TO6cLMesNaa/f0hg8GAEJSyrBBV2u9fs3thjuH8dbwXUwvkeUF7cpKHD5bJmk2sdYgIvRtLOOchAekP6jsYjQozygtaY2MM/xzgnKcoStpTU+R5jnUeVa1qgbKqqKqKyjqaaROTGLJmxl5/gLOOZpZtpI109fifBv+30VRVmSxe617xzv9Q1fUQ4hcNYb0qq4/W2pernz48evrk8QEQDy8JZ1znv+aXJXTj4At0AAAAAElFTkSuQmCC" ;
break ;
}
#endregion
return base64String ! = null ? Convert . FromBase64String ( base64String ) : null ;
}
2011-02-12 23:53:43 +00:00
private static void CreateInitialData ( ISession session , User creator ) {
#region systems
2011-02-27 08:47:16 +00:00
var fds = new GamingSystem { Abbreviation = "FDS" , Name = "Family Computer Disk System" , ReleaseDate = new DateTime ( 1986 , 2 , 21 ) , Icon = GetSystemIcon ( "fds" ) } ;
var nes = new GamingSystem { Abbreviation = "NES" , Name = "Nintendo Entertainment System" , ReleaseDate = new DateTime ( 1985 , 10 , 18 ) , Icon = GetSystemIcon ( "nes" ) } ;
var snes = new GamingSystem { Abbreviation = "SNES" , Name = "Super Nintendo Entertainment System" , ReleaseDate = new DateTime ( 1991 , 8 , 23 ) , Icon = GetSystemIcon ( "snes" ) } ;
var genny = new GamingSystem { Abbreviation = "Genesis" , Name = "Sega Genesis" , ReleaseDate = new DateTime ( 1989 , 10 , 14 ) , Icon = GetSystemIcon ( "genny" ) } ;
var ps = new GamingSystem { Abbreviation = "PS" , Name = "PlayStation" , ReleaseDate = new DateTime ( 1995 , 9 , 9 ) , Icon = GetSystemIcon ( "ps" ) } ;
var ps2 = new GamingSystem { Abbreviation = "PS2" , Name = "PlayStation 2" , ReleaseDate = new DateTime ( 2000 , 3 , 4 ) , Icon = GetSystemIcon ( "ps2" ) } ;
var xbox = new GamingSystem { Abbreviation = "Xbox" , Name = "Xbox" , ReleaseDate = new DateTime ( 2002 , 2 , 22 ) , Icon = GetSystemIcon ( "xbox" ) } ;
var n64 = new GamingSystem { Abbreviation = "N64" , Name = "Nintendo 64" , ReleaseDate = new DateTime ( 1996 , 9 , 29 ) , Icon = GetSystemIcon ( "n64" ) } ;
var gcn = new GamingSystem { Abbreviation = "GCN" , Name = "Nintendo GameCube" , ReleaseDate = new DateTime ( 2001 , 11 , 18 ) , Icon = GetSystemIcon ( "gcn" ) } ;
var dc = new GamingSystem { Abbreviation = "DC" , Name = "Dreamcast" , ReleaseDate = new DateTime ( 1999 , 9 , 9 ) , Icon = GetSystemIcon ( "dc" ) } ;
var wii = new GamingSystem { Abbreviation = "Wii" , Name = "Wii" , ReleaseDate = new DateTime ( 2006 , 11 , 19 ) , Icon = GetSystemIcon ( "wii" ) } ;
var xbox360 = new GamingSystem { Abbreviation = "360" , Name = "Xbox 360" , ReleaseDate = new DateTime ( 2005 , 11 , 16 ) , Icon = GetSystemIcon ( "360" ) } ;
var ps3 = new GamingSystem { Abbreviation = "PS3" , Name = "PlayStation 3" , ReleaseDate = new DateTime ( 2006 , 11 , 17 ) , Icon = GetSystemIcon ( "ps3" ) } ;
2011-02-12 23:53:43 +00:00
var tgfx = new GamingSystem { Abbreviation = "TGfx" , Name = "TurboGrafx-16 Entertainment SuperSystem" , ReleaseDate = new DateTime ( 1989 , 10 , 29 ) } ;
var pc = new GamingSystem { Abbreviation = "PC" , Name = "Personal Computer" , ReleaseDate = new DateTime ( 1980 , 1 , 1 ) } ;
2011-02-27 08:47:16 +00:00
var gb = new GamingSystem { Abbreviation = "GB" , Name = "Game Boy" , ReleaseDate = new DateTime ( 1989 , 7 , 31 ) , Icon = GetSystemIcon ( "gb" ) } ;
2011-02-12 23:53:43 +00:00
var gbc = new GamingSystem { Abbreviation = "GBC" , Name = "Game Boy Color" , ReleaseDate = new DateTime ( 1998 , 11 , 18 ) } ;
2011-02-27 08:47:16 +00:00
var gba = new GamingSystem { Abbreviation = "GBA" , Name = "Game Boy Advance" , ReleaseDate = new DateTime ( 2001 , 6 , 11 ) , Icon = GetSystemIcon ( "gba" ) } ;
var nds = new GamingSystem { Abbreviation = "NDS" , Name = "Nintendo DS" , ReleaseDate = new DateTime ( 2004 , 11 , 21 ) , Icon = GetSystemIcon ( "nds" ) } ;
var psp = new GamingSystem { Abbreviation = "PSP" , Name = "PlayStation Portable" , ReleaseDate = new DateTime ( 2005 , 3 , 24 ) , Icon = GetSystemIcon ( "psp" ) } ;
2011-02-12 23:53:43 +00:00
var arcade = new GamingSystem { Abbreviation = "Arcade" , Name = "Arcade" , ReleaseDate = new DateTime ( 1966 , 1 , 1 ) } ;
2011-02-09 19:28:33 +00:00
using ( var tx = session . BeginTransaction ( ) ) {
2011-02-12 23:53:43 +00:00
var repo = new NHibernateRepository < GamingSystem > ( session ) ;
2011-02-09 19:28:33 +00:00
repo . Save ( nes ) ;
2011-02-12 23:53:43 +00:00
repo . Save ( fds ) ;
2011-02-09 19:28:33 +00:00
repo . Save ( snes ) ;
repo . Save ( genny ) ;
repo . Save ( ps ) ;
repo . Save ( ps2 ) ;
repo . Save ( xbox ) ;
repo . Save ( n64 ) ;
repo . Save ( gcn ) ;
repo . Save ( dc ) ;
repo . Save ( wii ) ;
repo . Save ( xbox360 ) ;
repo . Save ( ps3 ) ;
repo . Save ( pc ) ;
repo . Save ( gb ) ;
repo . Save ( gbc ) ;
repo . Save ( gba ) ;
repo . Save ( nds ) ;
repo . Save ( psp ) ;
2011-02-12 23:53:43 +00:00
repo . Save ( arcade ) ;
repo . Save ( tgfx ) ;
2011-02-09 19:28:33 +00:00
tx . Commit ( ) ;
}
2011-02-12 23:53:43 +00:00
#endregion
2011-02-09 00:05:32 +00:00
2011-02-12 23:53:43 +00:00
#region publishers
var nintendo = new Publisher { Name = "Nintendo" , Website = "http://www.nintendo.com/" } ;
var snk = new Publisher { Name = "SNK" , Website = "http://www.snkplaymoreusa.com/" } ;
var sega = new Publisher { Name = "Sega" , Website = "http://www.sega.com/" } ;
var taito = new Publisher { Name = "Taito" , Website = "http://www.taito.com/" } ;
var kaga = new Publisher { Name = "Kaga Create" , Website = "http://www.kaga-create.co.jp/" } ;
using ( var tx = session . BeginTransaction ( ) ) {
var repo = new NHibernateRepository < Publisher > ( session ) ;
repo . Save ( nintendo ) ;
repo . Save ( snk ) ;
repo . Save ( sega ) ;
repo . Save ( taito ) ;
repo . Save ( kaga ) ;
tx . Commit ( ) ;
}
#endregion
#region categories
var engrish = new Category { Name = "Engrish" } ;
var danger = new Category { Name = "Danger" } ;
2011-02-23 09:19:32 +00:00
var smoke = new Category { Name = "Smoke" } ;
var dolphins = new Category { Name = "Dolphins" } ;
2011-02-12 23:53:43 +00:00
using ( var tx = session . BeginTransaction ( ) ) {
var repo = new NHibernateRepository < Category > ( session ) ;
repo . Save ( engrish ) ;
repo . Save ( danger ) ;
2011-02-23 09:19:32 +00:00
repo . Save ( smoke ) ;
repo . Save ( dolphins ) ;
2011-02-12 23:53:43 +00:00
tx . Commit ( ) ;
}
#endregion
#region games
var loz = new Game { Creator = creator , Name = "The Legend of Zelda" , Website = "http://www.zelda.com/" , Region = Region . NorthAmerica | Region . Japan | Region . PAL }
. AddSystem ( nes )
. AddSystem ( gba )
. AddSystem ( gcn )
. AddSystem ( fds )
. AddPublisher ( nintendo ) ;
var crystalis = new Game { Creator = creator , Name = "Crystalis" , Website = "http://en.wikipedia.org/wiki/Crystalis" , Region = Region . Japan | Region . NorthAmerica }
. AddSystem ( nes )
. AddSystem ( gbc )
. AddPublisher ( snk )
. AddPublisher ( nintendo ) ;
var zeroWing = new Game { Creator = creator , Name = "Zero Wing" , Website = "http://en.wikipedia.org/wiki/Zero_Wing" , Region = Region . Japan | Region . Europe }
. AddSystem ( genny )
. AddSystem ( arcade )
. AddSystem ( tgfx )
. AddPublisher ( taito )
. AddPublisher ( kaga )
. AddPublisher ( sega ) ;
2011-02-27 01:41:07 +00:00
var zelda2 = new Game { Creator = creator , Name = "Zelda II: The Adventure of Link" , Website = "http://en.wikipedia.org/wiki/Zelda_II:_The_Adventure_of_Link" , Region = Region . NorthAmerica | Region . Japan | Region . PAL }
. AddSystem ( nes )
. AddSystem ( fds )
. AddSystem ( gba )
. AddSystem ( gcn )
. AddPublisher ( nintendo ) ;
2011-02-12 23:53:43 +00:00
using ( var tx = session . BeginTransaction ( ) ) {
var repo = new NHibernateRepository < Game > ( session ) ;
repo . Save ( loz ) ;
repo . Save ( crystalis ) ;
repo . Save ( zeroWing ) ;
2011-02-27 01:41:07 +00:00
repo . Save ( zelda2 ) ;
2011-02-12 23:53:43 +00:00
tx . Commit ( ) ;
}
#endregion
#region quotes
2011-02-23 09:19:32 +00:00
var allYourBase = new Quote { Creator = creator , Game = zeroWing , Text = "All your base are belong to us." }
2011-02-12 23:53:43 +00:00
. AddCategory ( engrish )
. VoteFor ( creator , VoteDirection . Up ) ;
2011-02-23 09:19:32 +00:00
var dangerousToGoAlone = new Quote { Creator = creator , Game = loz , Text = "It's dangerous to go alone! Take this." }
2011-02-12 23:53:43 +00:00
. AddCategory ( danger )
. VoteFor ( creator , VoteDirection . Up ) ;
2011-02-23 09:19:32 +00:00
var dodongo = new Quote { Creator = creator , Game = loz , Text = "Dodongo dislikes smoke." }
. AddCategory ( smoke ) ;
2011-02-14 07:39:45 +00:00
var hopOnMyBack = new Quote { Creator = creator , Game = crystalis , Text = "Please hop on my back. I'll take you wherever you like." }
2011-02-23 09:19:32 +00:00
. AddCategory ( dolphins ) ;
2011-02-14 07:39:45 +00:00
2011-02-27 01:41:07 +00:00
var error = new Quote { Creator = creator , Game = zelda2 , Text = "I am Error." } ;
2011-02-12 23:53:43 +00:00
using ( var tx = session . BeginTransaction ( ) ) {
var repo = new NHibernateRepository < Quote > ( session ) ;
repo . Save ( allYourBase ) ;
2011-02-27 01:41:07 +00:00
repo . Save ( error ) ;
2011-02-12 23:53:43 +00:00
repo . Save ( dangerousToGoAlone ) ;
2011-02-14 07:39:45 +00:00
repo . Save ( hopOnMyBack ) ;
2011-02-23 09:19:32 +00:00
repo . Save ( dodongo ) ;
2011-02-12 23:53:43 +00:00
tx . Commit ( ) ;
}
#endregion
}
2011-02-09 00:05:32 +00:00
}
}