示例#1
0
        public NavigationViewModel(User user)
        {
            if (user == null) return;

            IsSystemAdmin = user.IsSystemAdmin;
            IsLeagueAdmin = true;
        }
示例#2
0
        public void Load_WillReturnExpectedAssociation()
        {
            // Arrange
            var expectedResult = new User { UserId = 1 };
            var fakeRepository = new Mock<IUserRepository>();
            fakeRepository.Setup(x => x.FindByUsername("username")).Returns(expectedResult);

            var service = new UserService(fakeRepository.Object, null, null, null);

            // Act
            var result = service.Load("username");

            // Assert
            Assert.That(result.UserId, Is.EqualTo(1));
        }
示例#3
0
文件: Player.cs 项目: batshev/Preds
 public Player(User player)
 {
     Id = player.UserId;
     Name = player.Name;
 }