Beispiel #1
0
        public void Start()
        {
            DateTime startDate;
            string   outputString = "";
            int      weekCount    = 0;

            try
            {
                Message.ShowTitle();

                IO.DirectoryCheck(Settings.Default.OutputPath);

                startDate = DateEdit.GetWeekStartDate(DateTime.Now);

                weekCount = DateEdit.GetWeekCount(startDate);

                Message.ShowTargetWeek(startDate, weekCount);

                outputString = Template.CreateOutputString(startDate, weekCount);

                if (IO.CreateTextFile(Settings.Default.OutputPath, Settings.Default.OutputFileName, outputString, false))
                {
                    Message.ShowFinishedMessage(true);
                }
                else
                {
                    Message.ShowFinishedMessage(false);
                }
            }
            catch (Exception ex)
            {
                Log.ExceptionOutput(ex, Settings.Default.LogPath, Settings.Default.LogFileName);
                throw;
            }
        }
Beispiel #2
0
        public void GetWeekCountTest()
        {
            DateTime testDate = DateTime.Parse("2018/07/19");

            int output = DateEdit.GetWeekCount(testDate);

            Assert.AreEqual(29, output);
        }