public NavigationViewModel(User user) { if (user == null) return; IsSystemAdmin = user.IsSystemAdmin; IsLeagueAdmin = true; }
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)); }
public Player(User player) { Id = player.UserId; Name = player.Name; }