예제 #1
0
        public User CurrentUser()
        {
            var user = new User { Email = "*****@*****.**", Measurements = new List<Measurement>() };
            user.AddMeasurement(new Measurement { Time = DateTime.Now, Weight = 120 });
            user.AddMeasurement(new Measurement { Time = DateTime.Now.AddDays(-1), Weight = 119.5 });
            user.AddMeasurement(new Measurement { Time = DateTime.Now.AddDays(-2), Weight = 119.2 });

            return user;
        }
예제 #2
0
        public void Get_IfLoggedIn_ReturnUserCorrectly()
        {
            // Arrange.
            var user = new User {Email = "*****@*****.**", Measurements = new List<Measurement>()};
            user.AddMeasurement(new Measurement {Time = DateTime.Now, Weight = 120});
            user.AddMeasurement(new Measurement { Time = DateTime.Now.AddDays(-1), Weight = 119.5 });
            user.AddMeasurement(new Measurement { Time = DateTime.Now.AddDays(-2), Weight = 119.2 });

            _loginInformation.CurrentUser().Returns(user);

            // Act and assert.
            _controller.Get().ShouldBeEquivalentTo(user);
        }