|
|
|
@ -54,8 +54,8 @@ namespace EF_UT
|
|
|
|
|
//prepares the database with one instance of the context
|
|
|
|
|
using (var context = new LoLDbContext(options))
|
|
|
|
|
{
|
|
|
|
|
ChampionEntity chewie = new ChampionEntity("Chewbacca", "", "");
|
|
|
|
|
ChampionEntity yoda = new ChampionEntity("Yoda", "", "");
|
|
|
|
|
ChampionEntity chewie = new ChampionEntity("Chewbacca", "ewa", "");
|
|
|
|
|
ChampionEntity yoda = new ChampionEntity("Yoda", "wewo", "");
|
|
|
|
|
ChampionEntity ewok = new ChampionEntity("Ewok", "", "");
|
|
|
|
|
|
|
|
|
|
context.Add(chewie);
|
|
|
|
@ -67,23 +67,23 @@ namespace EF_UT
|
|
|
|
|
//prepares the database with one instance of the context
|
|
|
|
|
using (var context = new LoLDbContext(options))
|
|
|
|
|
{
|
|
|
|
|
string NameToFind = "ew";
|
|
|
|
|
Assert.AreEqual(2, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
|
|
|
|
|
NameToFind = "ewo";
|
|
|
|
|
Assert.AreEqual(1, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
|
|
|
|
|
var ewok = context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).First();
|
|
|
|
|
ewok.Name = "Wicket";
|
|
|
|
|
string BioToFind = "ew";
|
|
|
|
|
Assert.AreEqual(2, context.Champions.Where(n => n.Bio.ToLower().Contains(BioToFind)).Count());
|
|
|
|
|
BioToFind = "ewo";
|
|
|
|
|
Assert.AreEqual(1, context.Champions.Where(n => n.Bio.ToLower().Contains(BioToFind)).Count());
|
|
|
|
|
var ewok = context.Champions.Where(n => n.Bio.ToLower().Contains(BioToFind)).First();
|
|
|
|
|
ewok.Bio = "Wicket";
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//prepares the database with one instance of the context
|
|
|
|
|
using (var context = new LoLDbContext(options))
|
|
|
|
|
{
|
|
|
|
|
string NameToFind = "ew";
|
|
|
|
|
Assert.AreEqual(1, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
|
|
|
|
|
NameToFind = "wick";
|
|
|
|
|
Assert.AreEqual(1, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
|
|
|
|
|
}
|
|
|
|
|
//using (var context = new LoLDbContext(options))
|
|
|
|
|
//{
|
|
|
|
|
// string NameToFind = "ew";
|
|
|
|
|
// Assert.AreEqual(1, context.Champions.Where(n => n.Bio.ToLower().Contains(NameToFind)).Count());
|
|
|
|
|
// NameToFind = "wick";
|
|
|
|
|
// Assert.AreEqual(1, context.Champions.Where(n => n.Bio.ToLower().Contains(NameToFind)).Count());
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|