public void AddActorShould_ThrowWhenActorExist() { var db = new TFContext(this.DatabaseSimulator()); var actorService = new ActorServices(db); Actor actorPesho = new Actor { ApiActorId = actorId, FullName = firstActorName }; actorService.AddActor(actorPesho); Assert.ThrowsException <EntityAlreadyExistingException>(() => actorService.AddActor(actorPesho)); }
public void AddActorShould_RestoreActor() { var db = new TFContext(this.DatabaseSimulator()); var actorService = new ActorServices(db); Actor actorPesho = new Actor { ApiActorId = actorId, FullName = firstActorName }; actorService.AddActor(actorPesho); actorPesho.IsDeleted = true; actorService.AddActor(actorPesho); Assert.IsFalse(actorPesho.IsDeleted); }
public void AddActorShould_AddActorCorrect() { var db = new TFContext(this.DatabaseSimulator()); var actorService = new ActorServices(db); var actor = new Actor() { Id = actorId, FullName = firstActorName }; var result = actorService.AddActor(actor); Assert.AreEqual(1, result.Id); }