Ejemplo n.º 1
0
        public void Create_ShouldReturnSqliteConnectionInstance_WhenRequestTypeIsSqliteConnection(
            Mock <ISpecimenContext> contextMock, SqliteConnectionBuilder builder)
        {
            var noSpecimen = builder.Create(typeof(SqliteConnection), contextMock.Object);

            noSpecimen.Should().BeOfType <SqliteConnection>();
        }
Ejemplo n.º 2
0
        public void Create_ShouldThrowArgumentException_WhenSpecimenContextIsNull(
            SqliteConnectionBuilder builder)
        {
            Action act = () => builder.Create(typeof(SqliteConnection), null);

            act.Should().ThrowExactly <ArgumentNullException>();
        }
Ejemplo n.º 3
0
        public void Create_ShouldCreateSqliteConnection_WithConnectionString_WhenRequestTypeIsSqliteConnection(
            Mock <ISpecimenContext> contextMock,
            SqliteConnectionBuilder builder)
        {
            var connection = builder.Create(typeof(SqliteConnection), contextMock.Object);

            connection.As <SqliteConnection>().ConnectionString.Should().Be("DataSource=:memory:");
        }
Ejemplo n.º 4
0
        public void Create_ShouldReturnNoSpecimen_WhenRequestTypeNotSqliteConnection(
            Mock <ISpecimenContext> contextMock,
            SqliteConnectionBuilder builder)
        {
            var noSpecimen = builder.Create(typeof(string), contextMock.Object);

            noSpecimen.Should().BeOfType <NoSpecimen>();
        }