public void TestSetInvalidPresetError()
        {
            var method = new CalculationMethod();

            Assert.Throws <ArgumentOutOfRangeException>(() => method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(),
                                                                                                CalculationMethodPreset.Custom));
        }
        public void TestSetPresetUniversityOfIslamicSciencesKarachi()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.UniversityOfIslamicSciencesKarachi);

            Assert.Equal(CalculationMethodPreset.UniversityOfIslamicSciencesKarachi, method.Preset);
            Assert.Equal(18.0, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(18.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }
        public void TestSetPresetUnionDesOrganisationsIslamiquesDeFrance()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.UnionDesOrganisationsIslamiquesDeFrance);

            Assert.Equal(CalculationMethodPreset.UnionDesOrganisationsIslamiquesDeFrance, method.Preset);
            Assert.Equal(12.0, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(12.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }
        public void TestSetPresetMuslimWorldLeague()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.MuslimWorldLeague);

            Assert.Equal(CalculationMethodPreset.MuslimWorldLeague, method.Preset);
            Assert.Equal(18.0, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(17.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }
        public void TestSetPresetIthnaAshari()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.IthnaAshari);

            Assert.Equal(CalculationMethodPreset.IthnaAshari, method.Preset);
            Assert.Equal(16.0, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(4.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.MaghribParameter.Type);
            Assert.Equal(14.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Jafari, method.MidnightMethod);
        }
        public void TestSetPresetIslamicSocietyOfNorthAmerica()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.IslamicSocietyOfNorthAmerica);

            Assert.Equal(CalculationMethodPreset.IslamicSocietyOfNorthAmerica, method.Preset);
            Assert.Equal(15.0, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(15.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }
        public void TestSetPresetInstituteOfGeophysicsUniversityOfTehran()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.InstituteOfGeophysicsUniversityOfTehran);

            Assert.Equal(CalculationMethodPreset.InstituteOfGeophysicsUniversityOfTehran, method.Preset);
            Assert.Equal(17.7, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(4.5, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.MaghribParameter.Type);
            Assert.Equal(14.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Jafari, method.MidnightMethod);
        }
        public void TestSetPresetEgyptianGeneralAuthorityOfSurvey()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.EgyptianGeneralAuthorityOfSurvey);

            Assert.Equal(CalculationMethodPreset.EgyptianGeneralAuthorityOfSurvey, method.Preset);
            Assert.Equal(19.5, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(17.5, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }
        public void TestSetPresetDepartmentOfIslamicAdvancementOfMalaysia()
        {
            var method = new CalculationMethod();

            method.SetCalculationMethodPreset(SystemClock.Instance.GetCurrentInstant(), CalculationMethodPreset.DepartmentOfIslamicAdvancementOfMalaysia);

            Assert.Equal(CalculationMethodPreset.DepartmentOfIslamicAdvancementOfMalaysia, method.Preset);
            Assert.Equal(20.0, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(18.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }
        // ReSharper disable once InconsistentNaming
        public void TestSetPresetUmmAlQuraUniversityOnRamadhan1st1435H()
        {
            var dateTime = new DateTime(2014, 6, 29, 0, 0, 0, DateTimeKind.Utc);
            var method   = new CalculationMethod();

            method.SetCalculationMethodPreset(Instant.FromDateTimeUtc(dateTime), CalculationMethodPreset.UmmAlQuraUniversity);

            Assert.Equal(CalculationMethodPreset.UmmAlQuraUniversity, method.Preset);
            Assert.Equal(18.5, method.FajrParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.Angle, method.FajrParameter.Type);
            Assert.Equal(0.0, method.MaghribParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.MaghribParameter.Type);
            Assert.Equal(120.0, method.IshaParameter.Value, 5);
            Assert.Equal(PrayerCalculationParameterType.MinutesAdjust, method.IshaParameter.Type);
            Assert.Equal(Midnight.Standard, method.MidnightMethod);
        }