public async Task EnterCompetition_MediatorSendsCorrectInput()
        {
            // Arrange
            var request             = _fixture.Create <EnterCompetition>();
            EnterCompetition actual = null;

            _mediatorMock.Setup(x => x.Send(request, default))
            .Callback((IRequest <Unit> req, CancellationToken token) => actual = req as EnterCompetition)
            .ReturnsAsync(new Unit());
            var controller = new CompetitionController(_mediatorMock.Object);

            // Act
            var response = await controller.EnterCompetition(request);

            // Assert
            actual.Should().Be(request);
        }
示例#2
0
    public static void ClearAll()
    {
        SearchResumeBank.SearchManifest = null;
        SearchResumeBank.SearchBuilder  = null;

        SearchJobPostings.SearchManifest = null;
        SearchJobPostings.SearchBuilder  = null;

        PlaceAnOrder.ShoppingCart  = null;
        RenewMembership.Membership = null;

        CustomizePage.Clear();


        RenewMembership.Clear();
        CreateAccount.Clear();
        RegisterForEvent.Clear();
        GroupRegistration.Clear();
        EnterCompetition.Clear();
        PostAJob.Clear();
        PlaceAnOrder.Clear();
        ViewChapterMembers.Clear();
        ViewSectionMembers.Clear();
        ViewOrganizationalLayerMembers.Clear();
        SearchDirectory.Clear();
        SearchJobPostings.Clear();
        SearchEventRegistrations.Clear();
        SearchResumeBank.Clear();
        AddContact.Clear();
        CustomizePage.Clear();
        // just wipe all keys
        // throw new NotSupportedException();

        /*
         * List<string> keys = new List<string>();
         * foreach (string key in HttpContext.Current.Session.Keys)
         *  if (key.StartsWith("MemberSuite:"))
         *      keys.Add(key);
         *
         * foreach( var key in keys )
         *      HttpContext.Current.Session[key] = null;
         * */
    }
示例#3
0
 public async Task <IActionResult> EnterCompetition(EnterCompetition request)
 {
     return(Ok(await _mediator.Send(request)));
 }