コード例 #1
0
        public void GetAllTSFA_ShouldReturnAllFemale()
        {
            List <TsfforAge> expected = GetAllTSFA_Female();

            var controller = new ChartController();
            var target     = controller.GetAllTSFA(2, 12, 8) as List <TsfforAge>;

            Assert.Equal(58 + 1, target.Count());

            var actual = (from l in target select l).FirstOrDefault();

            Assert.Equal((Sexes)expected.FirstOrDefault().Sex, (Sexes)actual.Sex);
            Assert.Equal(expected.FirstOrDefault().Month, actual.Month);
            Assert.Equal(expected.FirstOrDefault().M, actual.M);
            Assert.Equal(expected.FirstOrDefault().Sd0, actual.Sd0);
            Assert.Equal(expected.FirstOrDefault().P50, actual.P50);
            Assert.InRange((decimal)actual.P97, 0, 100);
        }
コード例 #2
0
        public async Task GetTSFA_MaleNewXNewY_ShouldReturnAllMale()
        {
            List <TsfforAge> expected = GetAllTSFA_Male();

            var controller = new ChartController(_context);
            var target     = await controller.GetAllTSFA(1, 12, 8) as List <TsfforAge>;

            Assert.Equal(58, target.Count);

            var actual = (from l in target select l).FirstOrDefault();

            Assert.Equal((Sexes)expected.FirstOrDefault().Sex, (Sexes)actual.Sex);
            Assert.Equal(expected.FirstOrDefault().Month, actual.Month);
            Assert.Equal(expected.FirstOrDefault().M, actual.M);
            Assert.Equal(expected.FirstOrDefault().Sd0, actual.Sd0);
            Assert.Equal(expected.FirstOrDefault().P50, actual.P50);
            Assert.InRange((decimal)actual.P97, 0, 100);
        }