public void InsertOrUpdate() { //Arrange MockImageRepo = new Mock <IImageRepository>(); MockLampRepo = new Mock <ILampRepository>(); var controllerLamp = new LampsController(MockLampRepo.Object, MockImageRepo.Object); var controllerImage = new ImagesController(MockImageRepo.Object); var image = new Image { ImageName = "good image", ImageExtension = ".jpg" }; var lamp = new Lamp { LampName = "meh lamp", Author = "meh author", ImageId = 1, Likes = 420 }; //Act controllerLamp.Create(lamp); //Assert MockLampRepo.Verify(m => m.InsertOrUpdate(lamp)); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); LampsController myTarget = (LampsController)target; if (GUILayout.Button("Znajdź światła")) { myTarget.FindAllLights(); } }
public void LampIndexViewNotNull() { // Arrange MockImageRepo = new Mock <IImageRepository>(); MockLampRepo = new Mock <ILampRepository>(); LampController = new LampsController(MockLampRepo.Object, MockImageRepo.Object); // Act ViewResult result = LampController.Index() as ViewResult; // Assert Assert.IsNotNull(result); }