コード例 #1
0
 public void Multiple_flags_Should_Set_ManyCategoryLabels()
 {
     var op = new OptionsParser(new List<string> {"-h", "-t", "-b"});
     Assert.True(op.Tags.Contains("Hus"));
     Assert.True(op.Tags.Contains("Business"));
     Assert.True(op.Tags.Contains("Travel"));
 }
コード例 #2
0
 public void Importance_Lp_ShouldBeParsedAsLowImportance()
 {
     var op = new OptionsParser(new List<string> {"-lp"});
     Assert.Equal(TaskPriority.Low, op.Importance);
 }
コード例 #3
0
 public void Importance_Hp_ShouldBeParsedAsHighImportance()
 {
     var op = new OptionsParser(new List<string> {"-hp"});
     Assert.Equal(TaskPriority.High, op.Importance);
 }
コード例 #4
0
 public void I_flag_Should_Set_Info_CategoryLabel()
 {
     var op = new OptionsParser(new List<string> {"-i"});
     Assert.True(op.Tags.Contains("Info"));
 }
コード例 #5
0
            public void WeFlag_ShouldReturn_ComingMonday()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-we"}, dateOfExecuting);

                Assert.Equal(DateTime.Parse("2012-11-21"), optionsParser.DueDate);
            }
コード例 #6
0
            public void Feb_InBeginning_Should_Return_FirstDayInFebruary()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-feb"}, dateOfExecuting);

                Assert.Equal(DateTime.Parse("2013-02-01"), optionsParser.DueDate);
            }
コード例 #7
0
 public void W_flag_Should_Set_Business_CategoryLabel()
 {
     var op = new OptionsParser(new List<string> {"-w"});
     Assert.True(op.Tags.Contains("Business"));
 }
コード例 #8
0
 public void P_flag_Should_Set_Personal_CategoryLabel()
 {
     var op = new OptionsParser(new List<string> {"-p"});
     Assert.True(op.Tags.Contains("Personal"));
 }
コード例 #9
0
 public void TmFlag_shouldRetrun_TomorrowsDate()
 {
     var optionsParser = new OptionsParser(new List<string> {"-tm"});
     Assert.Equal(DateTime.Today.AddDays(1), optionsParser.DueDate);
 }
コード例 #10
0
 public void H_flag_Should_Set_House_CategoryLabel()
 {
     var op = new OptionsParser(new List<string> {"-h"});
     Assert.True(op.Tags.Contains("Hus"));
 }
コード例 #11
0
 public void SwedishStyleDate20121015_ShouldParseToOctober15th2012()
 {
     var op = new OptionsParser(new List<string> {"-d2012-10-15"});
     Assert.Equal(DateTime.Parse("2012-10-15"), op.DueDate);
 }
コード例 #12
0
            public void Sep_InBeginning_Should_Return_FirstDayInSeptember()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-sep"}, dateOfExecuting);

                Assert.Equal(DateTime.Parse("2013-09-01"), optionsParser.DueDate);
            }
コード例 #13
0
 public void F_flag_Should_Set_Family_CategoryLabel()
 {
     var op = new OptionsParser(new List<string> {"-f"});
     Assert.True(op.Tags.Contains("Family"));
 }
コード例 #14
0
            public void Maj_InSwedish_InBeginning_Should_Return_FirstDayInMay()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-maj"}, dateOfExecuting);

                Assert.Equal(DateTime.Parse("2013-05-01"), optionsParser.DueDate);
            }
コード例 #15
0
 public void Importance_Nothing_ShouldBeParsedAsNormalImportance()
 {
     var op = new OptionsParser(new List<string> {""});
     Assert.Equal(TaskPriority.Normal, op.Importance);
 }
コード例 #16
0
 public void TodayFlag_ShouldReturn_TodaysDate()
 {
     var optionsParser = new OptionsParser(new List<string> {"-td"});
     Assert.Equal(DateTime.Today, optionsParser.DueDate);
 }
コード例 #17
0
            public void TwFlag_ShoudReturn_LastDayOfWeek_SE()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-tw"}, dateOfExecuting);

                DateTime expectedLastDayOfWeek = DateTime.Parse("2012-11-18");

                Assert.Equal(expectedLastDayOfWeek, optionsParser.DueDate);
            }
コード例 #18
0
 public void T_flag_Should_Set_Travel_CategoryLabel()
 {
     var op = new OptionsParser(new List<string> {"-t"});
     Assert.True(op.Tags.Contains("Travel"));
 }
コード例 #19
0
 public void UsStyleDate151012_ShouldParseToOctober15th2012()
 {
     var op = new OptionsParser(new List<string> {"-d10/15/2012"});
     Assert.Equal(DateTime.Parse("2012-10-15"), op.DueDate);
 }
コード例 #20
0
            public void Aug_InBeginning_Should_Return_FirstDayInAugust()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-aug"}, dateOfExecuting);

                Assert.Equal(DateTime.Parse("2013-08-01"), optionsParser.DueDate);
            }
コード例 #21
0
            public void Dec_InBeginning_Should_Return_FirstDayInOctober()
            {
                DateTime dateOfExecuting = DateTime.Parse("2012-11-16");
                var optionsParser = new OptionsParser(new List<string> {"-dec"}, dateOfExecuting);

                Assert.Equal(DateTime.Parse("2012-12-01"), optionsParser.DueDate);
            }