public void BuildName_ShouldSetNameFieldFromProductNameToken([Frozen] Mock <ITokenizer> tokenizerMock,
                                                                     InputLineModelBuilder sut)
        {
            // arrange
            tokenizerMock.Setup(m => m.Token).Returns(Token.ProductName);

            // act
            sut.BuildId(tokenizerMock.Object);

            // assert
            sut.Build().Name.ShouldBe(tokenizerMock.Object.Value);
        }
        public void Quantities_ShouldNotSetQuantitiesFieldFromNonWarehouseInfoToken(
            Token token, [Frozen] Mock <ITokenizer> tokenizerMock, InputLineModelBuilder sut)
        {
            // arrange
            tokenizerMock.Setup(m => m.Token).Returns(token);

            // act
            sut.BuildId(tokenizerMock.Object);

            // assert
            sut.Build().Quantities.ShouldBeEmpty();
        }
        public void BuildName_ShouldNotSetNameFieldFromNonProductIdToken(
            Token token, [Frozen] Mock <ITokenizer> tokenizerMock, InputLineModelBuilder sut)
        {
            // arrange
            tokenizerMock.Setup(m => m.Token).Returns(token);

            // act
            sut.BuildId(tokenizerMock.Object);

            // assert
            sut.Build().Name.ShouldBeNull();
        }
        public void Build_ShouldSetIsValidToTrueWhenIdAndNameBothSet(Mock <ITokenizer> idTokenizerMock, string name,
                                                                     Mock <ITokenizer> nameTokenizerMock, string id,
                                                                     InputLineModelBuilder sut)
        {
            // arrange
            idTokenizerMock.Setup(m => m.Token).Returns(Token.ProductId);
            idTokenizerMock.Setup(m => m.Value).Returns(name);
            sut.BuildId(idTokenizerMock.Object);

            nameTokenizerMock.Setup(m => m.Token).Returns(Token.ProductName);
            nameTokenizerMock.Setup(m => m.Value).Returns(id);
            sut.BuildName(nameTokenizerMock.Object);

            sut.Build();

            // act
            var actual = sut.IsValid;

            // assert
            actual.ShouldBeTrue();
        }