public void TryGetFlexiOptionsBlock_ReturnsNullIfAnFlexiOptionsBlockDoesNotExist() { // Arrange BlockProcessor dummyBlockProcessor = MarkdigTypesFactory.CreateBlockProcessor(); BlockOptionsFactory <IDummyOptions> testSubject = CreateBlockOptionsFactory(); // Act FlexiOptionsBlock result = testSubject.TryGetFlexiOptionsBlock(dummyBlockProcessor); // Assert Assert.Null(result); }
public void TryGetFlexiOptionsBlock_IfSuccessfulReturnsFlexiOptionsBlockAndRemovesItFromDocumentData() { // Arrange var dummyFlexiOptionsBlock = new FlexiOptionsBlock(null); BlockProcessor dummyBlockProcessor = MarkdigTypesFactory.CreateBlockProcessor(); dummyBlockProcessor.Document.SetData(FlexiOptionsBlockFactory.PENDING_FLEXI_OPTIONS_BLOCK, dummyFlexiOptionsBlock); BlockOptionsFactory <IDummyOptions> testSubject = CreateBlockOptionsFactory(); // Act FlexiOptionsBlock result = testSubject.TryGetFlexiOptionsBlock(dummyBlockProcessor); // Assert Assert.Same(dummyFlexiOptionsBlock, result); Assert.Null(dummyBlockProcessor.Document.GetData(FlexiOptionsBlockFactory.PENDING_FLEXI_OPTIONS_BLOCK)); }