Beispiel #1
0
        public async Task Compare_ValidParameters_SetsCorrectResourceAndMethod()
        {
            var sut = new RepositoryRepository(_requestFactory);

            await sut.Compare(0, "from", "to");

            _requestFactory.Received().Create("projects/{projectId}/repository/compare", Method.Get);
        }
Beispiel #2
0
        public async Task Compare_ValidParameters_AddsProjectIdUrlSegment()
        {
            const uint expected = 0;
            var        sut      = new RepositoryRepository(_requestFactory);

            await sut.Compare(expected, "from", "to");

            _request.Received().AddUrlSegment("projectId", expected);
        }
Beispiel #3
0
        public async Task Compare_ValidParameters_AddsToParameter()
        {
            const string expected = "to";
            var          sut      = new RepositoryRepository(_requestFactory);

            await sut.Compare(0, "from", expected);

            _request.Received().AddParameter("to", expected);
        }
Beispiel #4
0
        public async Task Compare_ToIsNull_ThrowsArgumentNullException()
        {
            var sut = new RepositoryRepository(_requestFactory);

            await Assert.ThrowsAsync <ArgumentNullException>(() => sut.Compare(0, "from", null));
        }