Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestableBase{T}"/> class.
 /// </summary>
 public TestableBase()
 {
     this.AutoMocker = AutoMock.GetLoose();
 }
 public void SetUp()
 {
     mocker = AutoMock.GetLoose();
 }
Example #3
0
 public void ProperInitializationIsPerformed()
 {
     AssertProperties(AutoMock.GetLoose());
     AssertProperties(AutoMock.GetStrict());
 }
Example #4
0
 private AutoMock GetMock()
 => AutoMock.GetLoose();
Example #5
0
 public void TestInitialize()
 {
     _mock = AutoMock.GetLoose();
     _mock.Create <CompanyRegisterRequestToUserConverter>();
 }
 public FilmManagementServiceTests()
 {
     _autoMockContext = AutoMock.GetLoose();
 }
 public void ExceptionMiddleWareSetup()
 {
     _mocker = AutoMock.GetLoose();
     _sut    = _mocker.Create <LoggingDataExtractor>();
 }
 public void ClassSetUp()
 {
     _mock = AutoMock.GetLoose();
 }
Example #9
0
 public void SetUp()
 {
     Container = AutoMock.GetLoose(cfg => OnSetup(cfg));
     //OnSetup();
 }
 public ScreeningManagementServiceTests()
 {
     _autoMockContext = AutoMock.GetLoose();
 }
 [SetUp] public void Setup()
 {
     _mock = AutoMock.GetLoose();
 }
 public SystemUnderTestFixture()
 {
     _mock = AutoMock.GetLoose();
 }
Example #13
0
 public void TestInitialize()
 {
     _mock = AutoMock.GetLoose();
     _mock.Create <CompanyRegisterController>();
 }
Example #14
0
 public TestClass()
 {
     Automock = AutoMock.GetLoose();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestAutoMockBase" /> class.
 /// </summary>
 public TestAutoMockBase()
 {
     AutoMock = AutoMock.GetLoose();
 }
Example #16
0
 public void TestInitialize()
 {
     _mock    = AutoMock.GetLoose();
     _service = _mock.Create <CompanyRegisterEmailNotificationService>();
 }
        public void TestInitialize()
        {
            _mock = AutoMock.GetLoose();

            _controller = _mock.Create <InvitationController>();
        }
Example #18
0
        public async Task WhenCallingGetYearToDatePayments_WithMultipleProviders_TheYtdPaymentsAreCorrect()
        {
            var mocker = AutoMock.GetLoose();

            var payments = new List <PaymentModel>
            {
                new PaymentModel
                {
                    Ukprn            = 1,
                    CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(2021, 1),
                    ContractType     = ContractType.Act1,
                    Amount           = 1000,
                },
                new PaymentModel
                {
                    Ukprn            = 1,
                    CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(2021, 1),
                    ContractType     = ContractType.Act2,
                    Amount           = 2000,
                },

                new PaymentModel
                {
                    Ukprn            = 2,
                    CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(2021, 1),
                    ContractType     = ContractType.Act1,
                    Amount           = 10000,
                },
                new PaymentModel
                {
                    Ukprn            = 2,
                    CollectionPeriod = CollectionPeriodFactory.CreateFromAcademicYearAndPeriod(2021, 1),
                    ContractType     = ContractType.Act2,
                    Amount           = 20000,
                },
            };



            using (var context = new InMemoryMetricsQueryDataContext())
            {
                var factory = mocker.Mock <IMetricsQueryDataContextFactory>();
                factory.Setup(x => x.Create())
                .Returns(context);
                var sut = mocker.Create <PeriodEndMetricsRepository>();

                foreach (var payment in payments)
                {
                    await context.AddAsync(payment);
                }

                await context.SaveChangesAsync();

                var actual = await sut.GetYearToDatePayments(2021, 2, CancellationToken.None);

                actual.Where(x => x.Ukprn == 1).Should().HaveCount(1);
                actual.Where(x => x.Ukprn == 2).Should().HaveCount(1);
                actual.Where(x => x.Ukprn == 3).Should().BeEmpty();

                actual.Single(x => x.Ukprn == 1).Total.Should().Be(3000);
                actual.Single(x => x.Ukprn == 2).Total.Should().Be(30000);
            }
        }
Example #19
0
        public void TestInitialize()
        {
            _mock = AutoMock.GetLoose();

            _provider = _mock.Create <EmployeeProvider>();
        }
Example #20
0
        public TodoCreateRequestValidatorTests()
        {
            var mock = AutoMock.GetLoose();

            _validator = mock.Create <TodoCreateRequestValidator>();
        }
 public BaselUnitTest()
 {
     var localAutoMock = AutoMock.GetLoose();
     App.SetContainer(localAutoMock.Container);
     MockPlatformServices.Init();
 }
        public void TestInitialize()
        {
            _mock = AutoMock.GetLoose();

            _service = _mock.Create <SetPasswordEmailService>();
        }
        public void TestInitialize()
        {
            _mock = AutoMock.GetLoose();

            _controller = _mock.Create <EmployeesController>();
        }
Example #24
0
 public void TestInitialize()
 {
     _mock = AutoMock.GetLoose();
     _mock.Create <CompanyNameTakenController>();
 }
Example #25
0
 public void GivenAValidCooldownRegistry()
 {
     _container = AutoMock.GetLoose();
     _registry  = _container.Create <CooldownRegistry>();
 }
 public void TestInitialize()
 {
     _mock = AutoMock.GetLoose();
 }
 public void Setup()
 {
     _mocker = AutoMock.GetLoose();
 }