コード例 #1
0
        public void GetResources_WhenValidInput_ShouldReturnNewResources(string command)
        {
            var resourcesFactory = new ResourcesFactory();

            var result = resourcesFactory.GetResources(command);

            Assert.IsInstanceOf<Resources>(result);
        }
コード例 #2
0
        public void GetResources_WhenInvalidInputIsPassed_ShouldThrowException(string command)
        {
            var resourcesFactory = new ResourcesFactory();

            Assert.That(() => resourcesFactory.GetResources(command), Throws.InvalidOperationException.With.Message.Contains("command"));
        }
コード例 #3
0
        public void GetResources_WhenInputStringIsNotInCorrectFormat_ShouldThrowException(string command)
        {
            var resourcesFactory = new ResourcesFactory();

            Assert.Throws<OverflowException>(() => resourcesFactory.GetResources(command));
        }