public void InvokeGetOrganizationWithCorrectOrganizationId() { var message = new OrganizationByIdQuery { OrganizationId = 1 }; var dataAccess = new Mock<IAllReadyDataAccess>(); var sut = new OrganizationByIdQueryHandler(dataAccess.Object); sut.Handle(message); dataAccess.Verify(x => x.GetOrganization(message.OrganizationId), Times.Once); }
public void InvokeGetOrganizationWithCorrectOrganizationId() { var THE_ID = 1; var message = new OrganizationByIdQuery { OrganizationId = THE_ID }; var sut = new OrganizationByIdQueryHandler(Context); var result = sut.Handle(message); Assert.Equal(result.Id, THE_ID); }
public void InvokeGetOrganizationWithCorrectOrganizationId() { var THE_ID = 1; var context = ServiceProvider.GetService<AllReadyContext>(); var message = new OrganizationByIdQuery { OrganizationId = THE_ID }; var sut = new OrganizationByIdQueryHandler(context); var result = sut.Handle(message); Assert.Equal(result.Id, THE_ID); }
public void InvokeGetOrganizationWithCorrectOrganizationId() { var THE_ID = 1; var context = ServiceProvider.GetService <AllReadyContext>(); var message = new OrganizationByIdQuery { OrganizationId = THE_ID }; var sut = new OrganizationByIdQueryHandler(context); var result = sut.Handle(message); Assert.Equal(result.Id, THE_ID); }
public void InvokeGetOrganizationWithCorrectOrganizationId() { var message = new OrganizationByIdQuery { OrganizationId = 1 }; var dataAccess = new Mock <IAllReadyDataAccess>(); var sut = new OrganizationByIdQueryHandler(dataAccess.Object); sut.Handle(message); dataAccess.Verify(x => x.GetOrganization(message.OrganizationId), Times.Once); }
public void Can_Retrieve_Organization() { // Setup Organization org1 = new Organization(), org2 = new Organization(), org3 = new Organization(); _unitOfWork.Organizations.Add(org1); _unitOfWork.Organizations.Add(org2); _unitOfWork.Organizations.Add(org3); _unitOfWork.Commit(); // Act Organization result = new OrganizationByIdQuery(_serviceFactory.Object).Execute(new OrganizationByIdQueryParams { OrganizationId = org2.Id }); // Verify Assert.AreEqual(org2, result, "Incorrect organization was returned"); }