public void can_read_a_single_toggle(string id, string state, bool expectedState) { var content = new[] { string.Format("{0}={1}", id, state), }; File.AppendAllLines(_filename, content); var sut = new TogglrSimpleFileValueProvider(_filename); var result = sut.GetById(id); Assert.AreEqual(expectedState, result.IsEnabled); }
public void test_sample_file_format() { using (var sourceStream = GetSampleTogglesAsStream()) { using (var fileStream = File.OpenWrite(_filename)) { sourceStream.CopyTo(fileStream); fileStream.Flush(); } } var valueProvider = new TogglrSimpleFileValueProvider(_filename); var toggle = valueProvider.GetById("TestFeature"); Assert.IsNotNull(toggle); }