コード例 #1
0
        public void TestConstructor_ShouldSetAnkleCorrectly(int height,
                                                            double weightKg,
                                                            double bodyFatPercent,
                                                            int chest,
                                                            int shoulders,
                                                            int forearm,
                                                            int arm,
                                                            int waist,
                                                            int hips,
                                                            int thighs,
                                                            int calves,
                                                            int neck,
                                                            int wrist,
                                                            int ankle,
                                                            string userId)
        {
            // Arrange,
            var date        = new DateTime(2, 3, 4);
            var measurement = new global::Logs.Models.Measurement(height, weightKg, bodyFatPercent, chest, shoulders, forearm, arm, waist, hips, thighs,
                                                                  calves, neck, wrist, ankle, userId, date);

            var list = new List <global::Logs.Models.Measurement> {
                measurement
            };

            var expected = list.Select(m => m.Ankle);

            // Act
            var model = new MeasurementStatsViewModel(list);

            // Assert
            CollectionAssert.AreEqual(expected, model.Ankle);
        }
コード例 #2
0
        public void TestConstructor_PassMeasurement_ShouldSetWeightKgCorrectly(int id,
                                                                               int height,
                                                                               double weightKg,
                                                                               double bodyFatPercent,
                                                                               int chest,
                                                                               int shoulders,
                                                                               int forearm,
                                                                               int arm,
                                                                               int waist,
                                                                               int hips,
                                                                               int thighs,
                                                                               int calves,
                                                                               int neck,
                                                                               int wrist,
                                                                               int ankle)
        {
            // Arrange
            var date        = new DateTime(1, 2, 3);
            var Measurement = new global::Logs.Models.Measurement(height, weightKg, bodyFatPercent, chest, shoulders, forearm, arm, waist, hips, thighs,
                                                                  calves, neck, wrist, ankle, null, date);

            Measurement.MeasurementsId = id;

            // Act
            var model = new MeasurementViewModel(Measurement, date);

            // Assert
            Assert.AreEqual(weightKg, model.WeightKg);
        }
コード例 #3
0
        public void TestConstructor_ShouldSetListModelCorrectly(int height,
                                                                double weightKg,
                                                                double bodyFatPercent,
                                                                int chest,
                                                                int shoulders,
                                                                int forearm,
                                                                int arm,
                                                                int waist,
                                                                int hips,
                                                                int thighs,
                                                                int calves,
                                                                int neck,
                                                                int wrist,
                                                                int ankle,
                                                                string userId)
        {
            // Arrange,
            var date        = new DateTime(2, 3, 4);
            var measurement = new global::Logs.Models.Measurement(height, weightKg, bodyFatPercent, chest, shoulders, forearm, arm, waist, hips, thighs,
                                                                  calves, neck, wrist, ankle, userId, date);

            var list = new List <global::Logs.Models.Measurement> {
                measurement
            };

            var expected = list.Select(m => new DateIdViewModel(m.MeasurementsId,
                                                                m.Date.ToString("dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture)))
                           .Reverse();

            // Act
            var model = new MeasurementStatsViewModel(list);

            // Assert
            CollectionAssert.AllItemsAreNotNull(model.ListModel);
        }