コード例 #1
0
        private bool IsPossibleToFill()
        {
            var gcdFinder = new GcdFinder(_firstCapacity, _secondCapacity);
            var result    = gcdFinder.Run();

            return(_targetFillAmount % result.GreaterCommonDivider == 0);
        }
コード例 #2
0
        public void Should_Find_Gcd_Correctly()
        {
            const int m      = 1769;
            const int n      = 551;
            var       finder = new GcdFinder(m, n);

            var result = finder.Run();

            Assert.Equal(m, result.FirstNumber);
            Assert.Equal(n, result.SecondNumber);
            Assert.Equal(5, result.FirstMultiplier);
            Assert.Equal(-16, result.SecondMultiplier);
            Assert.Equal(29, result.GreaterCommonDivider);
        }