Beispiel #1
0
        /// <summary>
        /// Creates a copy of this command, setting the credentials to the value configured by the specified delegate.
        /// </summary>
        public Command WithCredentials(Action <CredentialsBuilder> configure)
        {
            var builder = new CredentialsBuilder();

            configure(builder);

            return(WithCredentials(builder.Build()));
        }
        public void Credentials_can_be_set_with_a_builder()
        {
            // Arrange
            var builder = new CredentialsBuilder();

            // Act
            var credentials = builder
                              .SetDomain("domain")
                              .SetUserName("username")
                              .SetPassword("password")
                              .Build();

            // Assert
            credentials.Should().BeEquivalentTo(new Credentials("domain", "username", "password"));
        }
Beispiel #3
0
        public void I_can_build_credentials_from_individual_properties()
        {
            // Arrange
            var builder = new CredentialsBuilder();

            // Act
            var credentials = builder
                              .SetDomain("domain")
                              .SetUserName("username")
                              .SetPassword("password")
                              .Build();

            // Assert
            credentials.Should().BeEquivalentTo(new Credentials("domain", "username", "password"));
        }
Beispiel #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            CredentialsBuilder.SetCredentials();

            services.AddDbContext <DealershipDbContext>(options =>
                                                        options.UseSqlServer(CredentialsBuilder.ConnectionString));

            services.AddIdentity <ApplicationUser, IdentityRole>()
            .AddEntityFrameworkStores <DealershipDbContext>()
            .AddDefaultTokenProviders();

            // Add application services.
            services.AddTransient <ICarService, CarService>();
            services.AddTransient <IEmailService, EmailService>();
            services.AddTransient <IAccountService, AccountService>();
            services.AddTransient <ICommentService, CommentService>();

            services.AddMvc();
        }
Beispiel #5
0
 public void TestInitialization()
 {
     CredentialsBuilderUnderTest = new CredentialsBuilder();
 }