示例#1
0
        private DateTime GetYearEndDate(EChakraCode energy)
        {
            var firstOfYear = new DateTime(DateTime.Now.Year, 1, 1);

            switch (energy)
            {
            case EChakraCode.Pioneer:
            case EChakraCode.Akashic:
            case EChakraCode.Manifestor:
            case EChakraCode.Mystic:
                return(new DateTime(firstOfYear.Year, 12, 15));

            case EChakraCode.Peacemaker:
                return(new DateTime(firstOfYear.Year, 10, 1));

            case EChakraCode.Warrior:
                return(new DateTime(firstOfYear.Year, 07, 18));

            case EChakraCode.Royal:
                return(new DateTime(firstOfYear.Year, 07, 22));

            case EChakraCode.Healer:
            case EChakraCode.Elder:
                return(new DateTime(firstOfYear.Year, 11, 15));

            default:
                return(firstOfYear);
            }
        }
示例#2
0
        private DateTime GetMonthEndDate(EChakraCode energy, int month)
        {
            var firstOfMonth  = new DateTime(DateTime.Now.Year, month, 1);
            var previousMonth = firstOfMonth.AddMonths(-1);

            switch (energy)
            {
            case EChakraCode.Pioneer:
            case EChakraCode.Akashic:
            case EChakraCode.Manifestor:
            case EChakraCode.Mystic:
                return(new DateTime(firstOfMonth.Year, firstOfMonth.Month, 28).AddDays(1));

            case EChakraCode.Peacemaker:
                return(new DateTime(firstOfMonth.Year, firstOfMonth.Month, 23));

            case EChakraCode.Warrior:
                return(new DateTime(firstOfMonth.Year, firstOfMonth.Month, 17));

            case EChakraCode.Healer:
            case EChakraCode.Elder:
                return(new DateTime(firstOfMonth.Year, firstOfMonth.Month, 27));

            case EChakraCode.Royal:
                return(new DateTime(firstOfMonth.Year, firstOfMonth.Month, 18));

            default:
                return(firstOfMonth);
            }
        }
        //[InlineData(1984, 6, 21, EChakraCode.Healer, EChakraCode.Seer, EChakraCode.Warrior, EChakraCode.Healer, EChakraCode.Communicator, EChakraCode.Seer, EChakraCode.Seer)]
        public void CalculateTest(int year, int month, int day, EChakraCode dominant, EChakraCode subdominant, EChakraCode guide, EChakraCode gift, EChakraCode birthYear, EChakraCode currentYear, EChakraCode birthDharmaBaseCode, EChakraCode birthDharmaCode)
        {
            var model = new ChakraCodesModel(new PersonModel
            {
                DateOfBirth = new DateTime(year, month, day)
            });

            var mockAuthentication = new Mock <IAuthentication>();

            mockAuthentication.SetupGet(e => e.CurrentUserId).Returns(2);
            mockAuthentication.SetupGet(e => e.IsAuthenticated).Returns(true);

            var chakraCodeService = new ChakraCodesService();

            var result = chakraCodeService.CalculateChakraCodes(model);

            Assert.Equal(dominant, result.Dominant.ChakraCode);
            Assert.Equal(subdominant, result.SubDominant.ChakraCode);
            Assert.Equal(guide, result.Guide.ChakraCode);
            Assert.Equal(gift, result.Gift.ChakraCode);
            Assert.Equal(birthYear, result.BirthYear.ChakraCode);
            Assert.Equal(currentYear, result.CurrentYear.ChakraCode);
            Assert.Equal(birthDharmaBaseCode, result.DharmaCodes.First(e => e.Age == 0).DharmaChakraBaseCode);
            Assert.Equal(birthDharmaCode, result.DharmaCodes.First(e => e.Age == 0).DharmaChakraCode);

            Assert.False(result.Dominant.IsActive);
            Assert.False(result.SubDominant.IsActive);
            Assert.True(result.Guide.IsActive);
            Assert.False(result.Gift.IsActive);
        }
示例#4
0
 public static EChakraCode Decrement(this EChakraCode code)
 {
     return((int)code == 1 ? (EChakraCode)9 : code - 1);
 }
示例#5
0
 public static EChakraCode Increment(this EChakraCode code)
 {
     return((int)code == 9 ? (EChakraCode)1 : code + 1);
 }