Exemple #1
0
            public void Character()
            {
                using (var db = new EvefifoContext())
                {
                    var character = new Character
                    {
                        Name = "The Mittani",
                        CloneName = "Alpha",
                        CloneSP = 900000,
                        SP = 12345678,
                        CorpName = "Goonfleet",
                        SecStatus = -9.9,
                        ApiKey = new ApiKey { Id = 1234, Secret = "asdf" },
                        SkillQueue = new SkillQueue(new List<SkillQueue.Entry> { new SkillQueue.Entry(1, "two", 3, 4, 5, DateTime.Now, DateTime.Now) }),
                    };

                    db.Characters.Add(character);
                    db.SaveChanges();
                }

                using (var db = new EvefifoContext())
                {
                    var character = db.Characters.Single();
                    Assert.AreEqual("The Mittani", character.Name);
                    Assert.AreEqual(1234, character.ApiKey.Id);
                    Assert.AreEqual(1, character.SkillQueue.Entries.Count);
                }
            }
Exemple #2
0
 private static IRepository CreateRepo()
 {
     var repo = new Mock<IRepository>();
     var char1 = new Character { Name = "char1", Notifications = new List<Notification> { } };
     var char2 = new Character { Name = "char2", Notifications = new List<Notification> { null, null } };
     repo.Setup(x => x.Characters).ReturnsAsync(new List<Character>
     {
         char1, char2
     });
     return repo.Object;
 }
Exemple #3
0
 private static TestServer GetServer()
 {
     var repo = new Mock<IRepository>();
     var bob = new Character {
         Name = "Bob",
         Notifications = new List<Notification>(),
         SkillQueue = new SkillQueue(new List<SkillQueue.Entry> { new SkillQueue.Entry(123, "a skill", 3, 2, 3, DateTime.Now, DateTime.Now) })
     };
     repo.Setup(x => x.Characters).ReturnsAsync(new List<Character> {
         bob
     });
     repo.Setup(x => x.Character(1234)).ReturnsAsync(bob);
     repo.SetupGet(x => x.ApiKeys).ReturnsAsync(new List<ApiKey> {
         new ApiKey { Id = 1234, Secret = "api_secret_1" }
     });
     return TestServer.Create(Startup.Configuration(() => repo.Object));
 }
Exemple #4
0
 public CharacterModel(Character character, DateTime? now = null)
 {
     m_Character = character;
     m_Now = now ?? m_Now;
 }