public void TestAddNewActor_Returns_True() { ActorRepository actors = new ActorRepository(); actors.Add(new Actor("Emilia", "Lviv", 5, 1)); actors.Add(new Actor("John", "Lviv", 5, 3)); actors.Add(new Actor("Billy", "Kyiv", 5, 10)); bool result = actors.HasElement(new Actor("Emilia", "Lviv", 5, 1)); //assert Assert.IsTrue(result); }
public void TestSizeOfActorList_Returns_SizeList() { IRepository <Actor> actors = new ActorRepository(); actors.Add(new Actor("Emilia", "Lviv", 5, 1)); actors.Add(new Actor("John", "Lviv", 6, 3)); actors.Add(new Actor("Billy", "Kyiv", 10, 10)); int sizeActual = actors.GetSizeArr(); int sizeExpected = actors.Array().Count; //assert Assert.AreEqual(sizeActual, sizeExpected); }
public void TestTheMostPopularActor_Returns_ActorwithTheBiggestRatting() { ActorRepository actors = new ActorRepository(); actors.Add(new Actor("Emilia", "Lviv", 5, 1)); actors.Add(new Actor("John", "Lviv", 5, 3)); actors.Add(new Actor("Billy", "Kyiv", 5, 10)); string thisResult = actors.PopularObjStr(); string expectedResult = actors.ReturnActorInArrByIndex(2).ToString(); //assert Assert.AreEqual(thisResult, expectedResult); }
public IAsyncResult BeginGetOrderDetails(string customerId, string orderId, AsyncCallback callback, object state) { Guid requestId = CombGuid.Generate(); var actor = new OrderDetailRequestActor(requestId); ActorRepository.Add(actor); AsyncCallback asyncCallback = ar => { ActorRepository.Remove(actor); callback(ar); }; IAsyncResult asyncResult = actor.BeginAction(asyncCallback, state); Bus.Endpoint.Send(new InitiateOrderDetailsRequest() { RequestId = requestId, OrderId = orderId, CustomerId = customerId, }); return(asyncResult); }
public void TestRemoveActorByIndex_Returns_False() { ActorRepository actors = new ActorRepository(); actors.Add(new Actor("Emilia", "Lviv", 5, 1)); actors.Add(new Actor("John", "Lviv", 5, 3)); actors.Add(new Actor("Billy", "Kyiv", 5, 10)); actors.RemoveByIndex(1);// will be removed index=0 Actor actorTemp = new Actor("Emilia", "Lviv", 5, 1); bool result = actors.IsExist(actorTemp); //assert Assert.IsFalse(result); }
public ActionResult AddActor([Bind(Prefix = "Actor")] Actor item) { _acRep.Add(item); return(RedirectToAction("ActorList")); }
public void AddActor(actor actor) { _actorRepository.Add(actor); }