public HaikuDTO(Haiku h) { this.Id = h.Id; this.IsDeleted = h.IsDeleted; this.Text = h.Text; this.UserId = h.UserId; this.ActualRating = h.ActualRating; this.Date = h.Date; this.Username = h.Username; }
public void Insert() { SetUpTestData(); IBaseRepository<Haiku> repo = InitializeRepo(); _mockHaiku = repo.Add(_mockHaiku, _mockUser.Id); _mockHaiku.Id.Should().NotBe(0); _mockHaiku.Text.Should().NotBeNull(); _mockHaiku.RatersCount.Should().Be(0); _mockHaiku.RatingValue.Should().Be(0); _mockHaiku.ActualRating.Should().Be(0); _haikuId = (long)_mockHaiku.Id; }
private void SetUpTestData() { _mockUser = new User() { IsVip = false, PublishCode = "some test publish code", Username = "******" }; _mockUser = DataManager.GetDataManager().CreateInstance<User>().Add(_mockUser); _mockHaiku = RandomDataGenerator.GenerateHaiku(); }