public void GetEvents_WeekView_Success() { //Arrange var startDate = new DateTime(2015, 2, 9); var endDate = new DateTime(2015, 2, 15); var eventViewer = new EventViewer(_eventsRepositoryMock.Object); //Act Dictionary <DateTime, List <EventDto> > result = eventViewer.GetEvents(startDate, endDate); //Assert Assert.IsNotEmpty(result); Assert.IsEmpty(result[startDate]); Assert.AreEqual(7, result[startDate.AddDays(1)].Count); Assert.False(result[startDate.AddDays(1)].Any(e => e.Title == "Complex event 1")); Assert.False(result[startDate.AddDays(1)].Any(e => e.Title == "Complex event 2")); for (int i = 2; i < 7; i++) { Assert.AreEqual(1, result[startDate.AddDays(i)].Count); Assert.True(result[startDate.AddDays(i)].Any(e => e.Title == "Daily event")); } }
private void Log(string message) { // Add a new message to the event log message = string.Format(CultureInfo.CurrentUICulture, "[{0:hh:mm:ss}] {1}", DateTime.Now, message); EventLog.Children.Add(new TextBlock { Text = message }); // Scroll to the bottom of the event log EventViewer.ScrollToVerticalOffset(EventViewer.ExtentHeight); }
void Start() { Applications = GameObject.Find("Applications"); SysSoftware = GameObject.Find("System"); com = SysSoftware.GetComponent <Computer>(); appman = SysSoftware.GetComponent <AppMan>(); eventview = Applications.GetComponent <EventViewer>(); PosCheck(); native_height = Customize.cust.native_height; native_width = Customize.cust.native_width; windowRect.width = 185; windowRect.height = 200; ContextwindowRect.width = 100; CloseButton = new Rect(windowRect.width - 23, 2, 21, 21); DateString = new Rect(2, windowRect.height - 178, 200, 22); StartingDay = 1; DefaltTime.Day = 1; DefaltTime.DayNumber = 5; DefaltTime.Month = 1; DefaltTime.LeapYearCount = 2; DefaltTime.Year = 1970; DefaltTime.StartDay = 5; CurrentTimeUpdate(); Menu = "Dates"; Months.Add(""); Months.Add("Jan"); Months.Add("Feb"); Months.Add("Mar"); Months.Add("Apr"); Months.Add("May"); Months.Add("Jun"); Months.Add("Jul"); Months.Add("Aug"); Months.Add("Sep"); Months.Add("Oct"); Months.Add("Nov"); Months.Add("Dec"); }
public void GetEvents_OneDayView_Success() { //Arrange var date = new DateTime(2015, 2, 10); var eventViewer = new EventViewer(_eventsRepositoryMock.Object); //Act Dictionary <DateTime, List <EventDto> > result = eventViewer.GetEvents(date, date); //Assert Assert.IsNotEmpty(result); Assert.AreEqual(7, result[date].Count); Assert.False(result[date].Any(e => e.Title == "Complex event 1")); Assert.False(result[date].Any(e => e.Title == "Complex event 2")); }
public void GetEvents_MonthView_Success() { //Arrange var startDate = new DateTime(2015, 2, 1); var endDate = new DateTime(2015, 2, 28); var eventViewer = new EventViewer(_eventsRepositoryMock.Object); //Act Dictionary <DateTime, List <EventDto> > result = eventViewer.GetEvents(startDate, endDate); //Assert Assert.IsNotEmpty(result); for (int i = 0; i < 9; i++) { Assert.IsEmpty(result[startDate.AddDays(i)]); } Assert.AreEqual(7, result[startDate.AddDays(9)].Count); Assert.False(result[startDate.AddDays(9)].Any(e => e.Title == "Complex event 1")); Assert.False(result[startDate.AddDays(9)].Any(e => e.Title == "Complex event 2")); for (int i = 10; i < 28; i++) { if (i == 16 || i == 23) { Assert.AreEqual(2, result[startDate.AddDays(i)].Count); Assert.True(result[startDate.AddDays(i)].Any(e => e.Title == "Daily event")); Assert.True(result[startDate.AddDays(i)].Any(e => e.Title == "Weekly event")); } else { Assert.AreEqual(1, result[startDate.AddDays(i)].Count); Assert.True(result[startDate.AddDays(i)].Any(e => e.Title == "Daily event")); } } }
void Awake() { if (viewer == null) { viewer = this; } else { Destroy(this.gameObject); } eventImage = this.transform.Find("EventImage").GetComponent <RawImage>(); eventButton = this.transform.Find("EventButton").GetComponent <Button>(); Transform scrollViewContent = this.transform.Find("Scroll View").Find("Viewport").Find("Content"); eventDescription = scrollViewContent.Find("EventText").GetComponent <TextMeshProUGUI>(); eventEffects = scrollViewContent.Find("EventEffects").GetComponent <TextMeshProUGUI>(); eventEffectsTitle = scrollViewContent.Find("EventEffectsTitle").GetComponent <TextMeshProUGUI>(); Hide(); }
// Use this for initialization void Start() { System = GameObject.Find("System"); Applications = GameObject.Find("Applications"); Hacking = GameObject.Find("Hacking"); Other = GameObject.Find("Other"); Computer = GameObject.Find("Computer"); Prompts = GameObject.Find("Prompts"); WindowHandel = GameObject.Find("WindowHandel"); QA = GameObject.Find("QA"); winman = WindowHandel.GetComponent <WindowManager>(); history = Computer.GetComponent <SiteList>(); websecviewer = Computer.GetComponent <WebSecViewer>(); qa = QA.GetComponent <BugReport>(); //DESKTOP ENVIROMENT customtheme = Computer.GetComponent <CustomTheme>(); startmenu = System.GetComponent <AppMenu>(); rezprompt = Prompts.GetComponent <RezPrompt>(); desktop = System.GetComponent <Desktop>(); vc = System.GetComponent <VolumeController>(); //HACKING SOFTWARE pro = Hacking.GetComponent <Progtive>(); trace = Hacking.GetComponent <Tracer>(); dirsearch = Hacking.GetComponent <DirSearch>(); dicCrk = Hacking.GetComponent <DicCrk>(); passwordcracker = Hacking.GetComponent <PasswordCracker>(); dirsearch = Hacking.GetComponent <DirSearch>(); //STOCK SYSTEMS // port = Applications.GetComponent<Portfolio>(); // shareprompt = Prompts.GetComponent<SharePrompt>(); //OTHER PROMPTS purchaseprompt = Prompts.GetComponent <PurchasePrompt>(); //SYSTEM PROMPTS errorprompt = Prompts.GetComponent <ErrorProm>(); shutdownprompt = Prompts.GetComponent <ShutdownProm>(); installprompt = Prompts.GetComponent <InstallPrompt>(); //SYSTEM SOFTWARE sysclock = System.GetComponent <Clock>(); cli = System.GetComponent <CLI>(); cliv2 = System.GetComponent <CLIV2>(); os = System.GetComponent <OS>(); systempanel = System.GetComponent <SystemPanel>(); tasks = System.GetComponent <TaskViewer>(); com = System.GetComponent <Computer>(); diskman = System.GetComponent <DiskMan>(); vv = System.GetComponent <VersionViewer>(); fp = System.GetComponent <FileExplorer>(); SRM = System.GetComponent <SystemResourceManager>(); boot = System.GetComponent <Boot>(); deviceman = System.GetComponent <DeviceManager>(); executor = System.GetComponent <Executor>(); gatewayviewer = System.GetComponent <GatewayViewer>(); //LEGAL APPLICATIONS email = Applications.GetComponent <EmailClient>(); caluclator = Applications.GetComponent <Calculator>(); notepad = Applications.GetComponent <Notepad>(); notepadv2 = Applications.GetComponent <Notepadv2>(); accountlogs = Applications.GetComponent <AccLog>(); mp = Applications.GetComponent <MusicPlayer>(); treeview = Applications.GetComponent <TreeView>(); nv = Applications.GetComponent <NotificationViewer>(); pv = Applications.GetComponent <PlanViewer>(); calendar = Applications.GetComponent <Calendar>(); calendarv2 = Applications.GetComponent <CalendarV2>(); eventview = Applications.GetComponent <EventViewer>(); exchangeviewer = Applications.GetComponent <ExchangeViewer>(); //INTERNET BROWSERS internetbrowser = Applications.GetComponent <InternetBrowser>(); edgebrowser = Applications.GetComponent <NetViewer>(); firefoxbrowser = Applications.GetComponent <Firefox>(); //APPLICATIONS systemMap = Applications.GetComponent <SystemMap>(); textreader = Applications.GetComponent <TextReader>(); //BROWSER STUFF history = Computer.GetComponent <SiteList>(); //OTHER CONNECTION DEVICE rv = Applications.GetComponent <RemoteView>(); vmd = Other.GetComponent <VMDesigner>(); }
void ProgramSetup() { AppSoftware = GameObject.Find("Applications"); QA = GameObject.Find("QA"); HackingSoftware = GameObject.Find("Hacking"); SysSoftware = GameObject.Find("System"); Computer = GameObject.Find("Computer"); Other = GameObject.Find("Other"); Missions = GameObject.Find("Missions"); qa = QA.GetComponent <BugReport>(); //mb = GetComponent<MissionBrow>(); sl = Computer.GetComponent <SiteList>(); wsv = Computer.GetComponent <WebSecViewer>(); //Hacking Software pro = HackingSoftware.GetComponent <Progtive>(); trace = HackingSoftware.GetComponent <Tracer>(); ds = HackingSoftware.GetComponent <DirSearch>(); dc = HackingSoftware.GetComponent <DicCrk>(); passcrk = HackingSoftware.GetComponent <PasswordCracker>(); //System Sofware dsk = SysSoftware.GetComponent <Desktop>(); com = SysSoftware.GetComponent <Computer>(); ss = SysSoftware.GetComponent <ScreenSaver>(); sp = SysSoftware.GetComponent <SystemPanel>(); am = SysSoftware.GetComponent <AppMenu>(); tasks = SysSoftware.GetComponent <TaskViewer>(); clk = SysSoftware.GetComponent <Clock>(); cmd = SysSoftware.GetComponent <CLI>(); cmd2 = SysSoftware.GetComponent <CLIV2>(); os = SysSoftware.GetComponent <OS>(); dm = SysSoftware.GetComponent <DiskMan>(); mouse = SysSoftware.GetComponent <Mouse>(); fp = SysSoftware.GetComponent <FileExplorer>(); dem = SysSoftware.GetComponent <DeviceManager>(); vc = SysSoftware.GetComponent <VolumeController>(); //Application Softwate // port = AppSoftware.GetComponent<Portfolio>(); tr = AppSoftware.GetComponent <TextReader>(); sm = AppSoftware.GetComponent <SystemMap>(); al = AppSoftware.GetComponent <AccLog>(); note = AppSoftware.GetComponent <Notepad>(); notev2 = AppSoftware.GetComponent <Notepadv2>(); cc = AppSoftware.GetComponent <EmailClient>(); tv = AppSoftware.GetComponent <TreeView>(); nv = AppSoftware.GetComponent <NotificationViewer>(); pv = AppSoftware.GetComponent <PlanViewer>(); //calendar = AppSoftware.GetComponent<Calendar>(); calendarv2 = AppSoftware.GetComponent <CalendarV2>(); eventview = AppSoftware.GetComponent <EventViewer>(); exchangeview = AppSoftware.GetComponent <ExchangeViewer>(); // Application Browsers ib = AppSoftware.GetComponent <InternetBrowser>(); eib = AppSoftware.GetComponent <NetViewer>(); fib = AppSoftware.GetComponent <Firefox>(); rv = AppSoftware.GetComponent <RemoteView>(); cal = AppSoftware.GetComponent <Calculator>(); mp = AppSoftware.GetComponent <MusicPlayer>(); // Prompts ip = Prompts.GetComponent <InstallPrompt>(); pp = Prompts.GetComponent <PurchasePrompt>(); ep = Prompts.GetComponent <ErrorProm>(); sdp = Prompts.GetComponent <ShutdownProm>(); rp = Prompts.GetComponent <RezPrompt>(); // shareprompt = Prompts.GetComponent<SharePrompt>(); notiprompt = Prompts.GetComponent <NotfiPrompt>(); //OTHER vmd = Other.GetComponent <VMDesigner>(); // Computer ct = Computer.GetComponent <CustomTheme>(); //Missions misgen = Missions.GetComponent <MissionGen>(); }