Beispiel #1
0
        public async Task LogViewSensitiveData_HeaderBadRequest()
        {
            try
            {
                var tmpFixture        = new AccountControllerFixture();
                var requestHeaderInfo = Substitute.For <IRequestHeaderInfo>();
                requestHeaderInfo.GetUserName().Returns("");
                tmpFixture.Builder.RegisterInstance(requestHeaderInfo);
                tmpFixture.Container = tmpFixture.Builder.Build();
                var tmpController = tmpFixture.Container.Resolve <AccountController>();

                var response = await tmpController.LogViewSensitiveData(new LogViewSensitiveDataRequest
                {
                    FullName = "Martin Cheng",
                });
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOf <BadRequestException>(ex);
            }
        }
Beispiel #2
0
 public AccountControllerTest()
 {
     _fixture           = new AccountControllerFixture();
     _fixture.Container = _fixture.Builder.Build();
     _controller        = _fixture.Container.Resolve <AccountController>();
 }