예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }