public void ShouldApplyMask()
        {
            // Arrange
            var parameter = new DockingParameter(11, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X");

            // Act
            var res = parameter.ApplyMask();

            // Assert
            res.Should().Be(73);
        }
Beispiel #2
0
        public long ProcessInput(List <string> inputList)
        {
            foreach (var input in inputList)
            {
                var instruction = new Instruction(input);
                if (instruction.Operation == OperationType.Mask)
                {
                    mask = instruction.MaskValue;
                }
                else if (instruction.Operation == OperationType.StoreMemory)
                {
                    var parameter = new DockingParameter(instruction.MemoryStorageValue.Value, mask);
                    memory[instruction.MemoryStorageValue.Address] = parameter.ApplyMask();
                }
            }

            return(CalculateSum());
        }