public CheckoutServiceTests()
 {
     _logger = new NullLogger <CheckoutService>();
     _mapper = new Mapper(new MapperConfiguration(cfg
                                                  => cfg.AddProfile(new AutoMapperProfiles())));
     _factory = new TestDataContextFactory();
 }
        public void Constructor_Always_InvokesBaseConstructor()
        {
            var modixContext = TestDataContextFactory.BuildTestDataContext();

            var uut = new ConfigurationActionRepository(modixContext);

            uut.ModixContext.ShouldBeSameAs(modixContext);
        }
 public void CreateDbContextTest ()
 {
     var dbContextFactory = new TestDataContextFactory ();
     using (var db = dbContextFactory.Create ()) {
         db.Set<EmployeeInfo> ().Add (new EmployeeInfo ());
         db.SaveChanges ();
     }
 }
        public void Constructor_Always_ModixContextIsGiven()
        {
            var modixContext = TestDataContextFactory.BuildTestDataContext();

            var uut = Substitute.For <RepositoryBase>(modixContext);

            uut.ModixContext.ShouldBeSameAs(modixContext);
        }
Example #5
0
        public override void Given()
        {
            Configure(with =>
            {
                with.Module <RootModule>();
                with.Dependency <IEmailService>(Substitute.For <IEmailService>());
                with.Dependency <DataContext>(TestDataContextFactory.Build());
            });

            base.Given();
        }
Example #6
0
        private static (ModixContext, GuildChannelRepository) BuildTestContext()
        {
            var modixContext = TestDataContextFactory.BuildTestDataContext(x =>
            {
                x.GuildChannels.AddRange(GuildChannels.Entities.Clone());
            });

            var uut = new GuildChannelRepository(modixContext);

            return(modixContext, uut);
        }
        private static (ModixContext, GuildRoleRepository) BuildTestContext()
        {
            var modixContext = TestDataContextFactory.BuildTestDataContext(x =>
            {
                x.Set <GuildRoleEntity>().AddRange(GuildRoles.Entities.Clone());
            });

            var uut = new GuildRoleRepository(modixContext);

            return(modixContext, uut);
        }
        private static (ModixContext, TagRepository) BuildTestContext()
        {
            var modixContext = TestDataContextFactory.BuildTestDataContext(x =>
            {
                x.Users.AddRange(Users.Entities.Clone());
                x.GuildUsers.AddRange(GuildUsers.Entities.Clone());
                x.Tags.AddRange(Tags.Entities.Clone());
                x.TagActions.AddRange(TagActions.Entities.Clone());
            });

            var uut = new TagRepository(modixContext);

            return(modixContext, uut);
        }
        private static (ModixContext, ConfigurationActionRepository) BuildTestContext()
        {
            var modixContext = TestDataContextFactory.BuildTestDataContext(x =>
            {
                x.Users.AddRange(Users.Entities.Clone());
                x.GuildUsers.AddRange(GuildUsers.Entities.Clone());
                x.GuildRoles.AddRange(GuildRoles.Entities.Clone());
                x.GuildChannels.AddRange(GuildChannels.Entities.Clone());
                x.ClaimMappings.AddRange(ClaimMappings.Entities.Clone());
                x.DesignatedChannelMappings.AddRange(DesignatedChannelMappings.Entities.Clone());
                x.DesignatedRoleMappings.AddRange(DesignatedRoleMappings.Entities.Clone());
                x.ConfigurationActions.AddRange(ConfigurationActions.Entities.Clone());
            });

            var uut = new ConfigurationActionRepository(modixContext);

            return(modixContext, uut);
        }
Example #10
0
 public LibraryAssetServiceTests()
 {
     _factory = new TestDataContextFactory();
 }
 public CategoryServiceTests()
 {
     _factory = new TestDataContextFactory();
 }
 public AssetTypeServiceTests()
 {
     _factory = new TestDataContextFactory();
 }
Example #13
0
 public void SetUp()
 {
     context = TestDataContextFactory.Build();
 }
Example #14
0
 public AuthorServiceTests()
 {
     _factory = new TestDataContextFactory();
 }