public GitVersionRepositoryFixture()
 {
     _environment = Substitute.For <IVersionEnvironment>();
     _environment.CanonicalBranchName.Returns((string)null);
     _environment.BranchName.Returns((string)null);
     _serializer = new Serializer();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VersionContext"/> class.
 /// </summary>
 /// <param name="environment">The <see cref="IVersionEnvironment"/> for the invocation.</param>
 /// <param name="configuration">The <see cref="VersionConfiguration"/> for the current branch.</param>
 /// <param name="result">The <see cref="VersionResult"/> to collect final version details.</param>
 public VersionContext(
     IVersionEnvironment environment,
     VersionConfiguration configuration,
     VersionResult result)
 {
     Environment   = environment ?? throw new ArgumentNullException(nameof(environment));
     Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     Result        = result ?? throw new ArgumentNullException(nameof(result));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GitVersionRepository"/> class.
 /// </summary>
 /// <param name="path">The path to the repository.</param>
 /// <param name="environment">The environment for the invocation.</param>
 /// <param name="serializer">The serializer for reading documents.</param>
 /// <param name="processors">The processors to be called on.</param>
 public GitVersionRepository(
     string path,
     IVersionEnvironment environment,
     ISerializer serializer,
     IEnumerable <IVersionProcessor> processors)
 {
     // Resolve the underlying repository
     _repo        = GetRepository(path);
     _environment = Assert.ArgumentNotNull(environment, nameof(environment));
     _serializer  = Assert.ArgumentNotNull(serializer, nameof(serializer));
     _processors  = Assert.ArgumentNotNull(processors, nameof(processors)).ToArray();
 }
Exemplo n.º 4
0
 public VersionContextFixture()
 {
     _environment = Substitute.For <IVersionEnvironment>();
     _config      = new VersionConfiguration();
     _result      = new VersionResult();
 }