Пример #1
0
        public void TestInitialize()
        {
            ea  = new EventAccess();
            ep  = new EventProcessor();
            eca = new EventCharacterAccess();
            ecp = new EventCharacterProcessor();

            string   eventName             = "Test Raid";
            string   eventType             = "Raid";
            string   location              = "266,070";
            DateTime date                  = new DateTime(2020, 12, 10, 12, 0, 0);
            string   description           = "Doing a full raid. Be available for at least 2 hours";
            int      maxNumberOfCharacters = 25;
            string   guildID               = "99999999-9999-9999-9999-999999999999";

            testEvent = new Event(guildID, eventName, description, eventType, location, date, maxNumberOfCharacters);

            string characterName = "Bob";
            string race          = "Demon";
            string gender        = "Both";
            string profession    = "Janitor";
            int    level         = 95;
            string guild         = "A guild";
            int    age           = 900;
            string created       = "Yes";
            int    deaths        = 1;
            string title         = "Title";

            testCharacter = new Character(characterName, race, gender, profession, level, guild, age, created, deaths, title);

            ep.InsertEvent(testEvent.Name, testEvent.EventType, testEvent.Location,
                           testEvent.Date, testEvent.Description, testEvent.MaxNumberOfCharacters, testEvent.GuildID);
            testEvent.EventID = ea.GetIdOfEvent(testEvent.Name);
        }
Пример #2
0
        public bool Open(EventAccess dwDesiredAccess, bool bInheritHandle, string lpName)
        {
            m_Handle = NTKernel.OpenEvent((int)dwDesiredAccess, bInheritHandle, lpName);

            if (m_Handle == IntPtr.Zero)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Пример #3
0
        public void TestInitialize()
        {
            ea = new EventAccess();
            ep = new EventProcessor();

            string   name                  = "Test Raid";
            string   eventType             = "Raid";
            string   location              = "266,070";
            DateTime date                  = new DateTime(2020, 12, 10, 12, 0, 0);
            string   description           = "Doing a full raid. Be available for at least 2 hours";
            int      maxNumberOfCharacters = 25;
            string   guildID               = "99999999-9999-9999-9999-999999999999";

            testEvent = new Event(guildID, name, description, eventType, location, date, maxNumberOfCharacters);
        }
Пример #4
0
        public void TestIfDeleteEventCallsDeleteEventInRepo()
        {
            // Arrange

            var repo    = new Mock <IEventRepository>();
            var manager = new EventAccess(repo.Object);


            // Act

            manager.DeleteEvent(It.IsAny <int>());


            // Assert

            repo.Verify(x => x.DeleteEvent(It.IsAny <int>()), Times.Exactly(1));
        }
Пример #5
0
        public void TestIfUpdateEventCallsUpdateEventInRepo()
        {
            // Arrange

            var repo    = new Mock <IEventRepository>();
            var manager = new EventAccess(repo.Object);


            // Act

            manager.UpdateEvent(It.IsAny <Event>(), It.IsAny <IEnumerable <int> >());


            // Assert

            repo.Verify(x => x.UpdateEvent(It.IsAny <Event>(), It.IsAny <IEnumerable <int> >()), Times.Exactly(1));
        }
Пример #6
0
        public void TestIfGetArchivedEventsCallsGetArchivedEventsInRepo()
        {
            // Arrange

            var repo    = new Mock <IEventRepository>();
            var manager = new EventAccess(repo.Object);


            // Act

            manager.GetArchivedEvents();


            // Assert

            repo.Verify(x => x.GetArchivedEvents(), Times.Exactly(1));
        }
Пример #7
0
        public void TestIfAddEventCallsAddEventInRepo()
        {
            // Arrange

            var repo    = new Mock <IEventRepository>();
            var manager = new EventAccess(repo.Object);

            var intList = new List <int> {
                0, 21, 31, 12, 59
            };


            // Act

            manager.AddEvent(It.IsAny <Event>(), intList);


            // Assert

            // AddEvent should be called x times equal to the amount of ints in the intList
            repo.Verify(x => x.AddEvent(It.IsAny <Event>(), It.IsAny <int>()), Times.Exactly(5));
        }
Пример #8
0
 internal static extern IntPtr CreateEventEx(IntPtr lpEventAttributes, IntPtr lpName, int dwFlags,
                                             EventAccess dwDesiredAccess);
Пример #9
0
 internal static extern IntPtr CreateEventExW(IntPtr lpEventAttributes, IntPtr lpName, int dwFlags,
                                              EventAccess dwDesiredAccess);
Пример #10
0
 internal static extern EventSafeHandle OpenEvent(EventAccess desiredAccess, bool inheritHandle, string lpName);
Пример #11
0
 public EventLogic()
 {
     eventAccess    = new EventAccess();
     iAppLogManager = new AppLogManager();
 }
Пример #12
0
 public static extern NtStatus NtOpenEvent(
     [Out] out IntPtr EventHandle,
     [In] EventAccess DesiredAccess,
     [In] ref OBJECT_ATTRIBUTES ObjectAttributes);
Пример #13
0
 public EventController(DatabaseInterface db)
 {
     _db    = db;
     _Event = new EventAccess(db);
 }
Пример #14
0
 public AppDataTest()
 {
     baseAccess  = new BaseAccess();
     eventAccess = new EventAccess();
 }