Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestMethod]
- public void CreateLampTest()
- {
- // Arrange
- MockImageRepo = new Mock<IImageRepository>();
- MockLampRepo = new Mock<ILampRepository>();
- LampController = new LampsController(MockLampRepo.Object, MockImageRepo.Object);
- var lamp = new Lamp
- {
- LampName = "meh lamp",
- Author = "meh author",
- ImageId = 1,
- Likes = 420
- };
- LampController.Create(lamp);
- IEnumerable<Lamp> lamps = new List<Lamp>();
- MockLampRepo.Setup(x => x.GetAll("")).Returns(lamps);
- // Act
- // Assert
- int count = 0;
- foreach (Lamp element in lamps)
- {
- count++;
- }
- Assert.AreEqual(1, count);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement