public void ThenIWantItToBeStored() { // Arrange var document = new Document(); var value = new ClassWithFieldAttributes { FieldOne = "Test", FieldTwo = "Test2" }; // Act document.AddFields(value); // Assert Assert.Equal(value.FieldOne, document.GetString("FieldOne")); Assert.Equal(value.FieldTwo, document.GetString("FieldTwo")); }
public void ThenIWantAnErrorWhenTheValueIsNotStored() { // Arrange var document = new Document(); // Act // Assert Assert.Throws<InvalidOperationException>(() => document.GetString("Foo")); }
public void ThenIWantItToBeStored() { // Arrange var document = new Document(); var input = "Bar"; // Act document.Add(input).Stored().As("Foo"); // Assert var output = document.GetString("Foo"); Assert.Equal(input, output); }