Beispiel #1
0
        public IActionResult GetSoftwareGreaterThan(string version)
        {
            // TODO: validate inputs
            var software = _softwareService.GetSoftwareGreaterThan(version);

            return(View("Index", software));
        }
Beispiel #2
0
        public void GetSoftwareGreaterThan_Should_Return_Correct_Values(string version, int expected)
        {
            // arrange (could be shifted to ctor)
            _softwareManager.GetAllSoftware().Returns(
                new List <Software>
            {
                new Software
                {
                    Name    = "MS Word",
                    Version = "13.2.1."
                },
                new Software
                {
                    Name    = "Angular1",
                    Version = "1.0.9"
                },
                new Software
                {
                    Name    = "Angular2",
                    Version = "2"
                },
                new Software
                {
                    Name    = "Doom",
                    Version = "0.0.5"
                },
                new Software
                {
                    Name    = "Clippy",
                    Version = "2.1"
                },
                new Software
                {
                    Name    = "Visual Studio",
                    Version = "2017.0.1"
                },
                new Software
                {
                    Name    = "Sublime3",
                    Version = "3.9"
                },
                new Software
                {
                    Name    = "Call of Duty",
                    Version = "9.9.9"
                }
            });

            // act
            var result = _softwareService.GetSoftwareGreaterThan(version);

            // assert
            Assert.Equal(expected, result.ToList().Count);
        }