public void TrackPolymerCorrectly_WhenUsingRealInput(int steps, string expectedTemplate)
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(REAL_INPUT);

            sut.RunFor(steps);
            Assert.Equal(expectedTemplate, sut.PolymerTemplate);
        }
        public void ReturnCorrectPolymerTemplateLength_AfterSteps(int steps, int expectedLength)
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(SAMPLE_INPUT);

            sut.RunFor(steps);
            Assert.Equal(expectedLength, sut.PolymerTemplate.Length);
        }
        public void GetCorrectSubtractionOnSampleData_WhenTrackingPolymers()
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(SAMPLE_INPUT);

            sut.RunFor(10);
            Assert.Equal(1588, sut.GetSubtraction());
        }
        public void ReturnCorrectPolymerTemplate(int steps, string expectedTemplate)
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(SAMPLE_INPUT);

            sut.RunFor(steps);
            Assert.Equal(expectedTemplate, sut.PolymerTemplate);
        }
        public void BeInitializedCorrectly_WhenCorrectInputIsSupplied(string input, string expectedTemplate, int expectedRulesCount)
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(input);

            Assert.Equal(expectedTemplate, sut.PolymerTemplate);
            Assert.Equal(expectedRulesCount, sut.GetPairInsertionRulesCount());
        }
        public void SolveFirstPuzzle_WhenTrackingPolymers()
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(REAL_INPUT);

            sut.RunFor(10);
            Assert.Equal(2233, sut.GetSubtraction());
        }
        public void CreatePolymerChainWithCorrectNumberOfPolymers()
        {
            var sut = PolymerizationEquipment.CreateEquipmentTrackingPolymers(SAMPLE_INPUT);

            sut.RunFor(10);
            Assert.Equal(1749, sut.CountElementInTemplate("B"));
            Assert.Equal(298, sut.CountElementInTemplate("C"));
            Assert.Equal(161, sut.CountElementInTemplate("H"));
            Assert.Equal(865, sut.CountElementInTemplate("N"));
        }
        public void ThrowException_WhenInitializedWithInvalidTemplate(string invalidInput)
        {
            var exception = Assert.Throws <ArgumentException>(() => PolymerizationEquipment.CreateEquipmentTrackingPolymers(invalidInput));

            Assert.Equal("Invalid input", exception.Message);
        }