Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 2fd8ae4

Browse files
committed
update Setup Repository to mock new method
1 parent e3b8168 commit 2fd8ae4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/UnitTests/GitHub.Exports/LocalRepositoryModelTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Xunit;
88
using GitHub.Primitives;
99
using Xunit.Abstractions;
10+
using System.Collections.Generic;
1011

1112
[Collection("PackageServiceProvider global data tests")]
1213
public class LocalRepositoryModelTests : TestBaseClass
@@ -25,7 +26,11 @@ static void SetupRepository(string sha)
2526
var repo = Substitute.For<IRepository>();
2627
gitservice.GetRepository(Args.String).Returns(repo);
2728
if (!String.IsNullOrEmpty(sha))
28-
{
29+
{
30+
var refs = Substitute.For<ReferenceCollection>();
31+
var refrence = Substitute.For<Reference>();
32+
refs.ReachableFrom(Arg.Any<IEnumerable<Reference>>(), Arg.Any<IEnumerable<Commit>>()).Returns(new Reference[] { refrence });
33+
repo.Refs.Returns(refs);
2934
var commit = Substitute.For<Commit>();
3035
commit.Sha.Returns(sha);
3136
repo.Commits.Returns(new FakeCommitLog { commit });

0 commit comments

Comments
 (0)