Ejemplo n.º 1
0
        public void Should_still_return_data_when_not_insync()
        {
            // Arrange
            var sut = new MockarooRepository <BasicObject>(Config.GetApikey(), 10);

            // Act
            var result1 = sut.First().StringValue;

            sut.Schema.Replace(x => x.NumericValue, DataType.RowNumber);
            var result2 = sut.First().StringValue;

            // Assert
            result1.ShouldNotBeNullOrEmpty();
            result2.ShouldNotBeNullOrEmpty();
        }
Ejemplo n.º 2
0
        public void Can_fetch_and_save_data_to_disk()
        {
            // Arrange
            string folder = Path.Combine(Path.GetTempPath(), "basic");
            var    sut    = new MockarooRepository <BasicObject>(Config.GetApikey(), 10, folder, true);

            // Act
            var result1 = sut.First().StringValue;
            var result2 = sut.First().StringValue;

            // Assert
            Directory.Exists(folder).ShouldBeTrue();
            result1.ShouldNotBeNullOrEmpty();
            result2.ShouldNotBeNullOrEmpty();
            result1.ShouldBe(result2);
        }
Ejemplo n.º 3
0
        public void Can_fetch_new_data()
        {
            // Arrange
            string folder = Path.Combine(Path.GetTempPath(), "freshdata");
            var    sut    = new MockarooRepository <BasicObject>(Config.GetApikey(), 10, folder, true);

            // Act
            var result1 = sut.First().StringValue;

            sut.Refresh();
            var result2 = sut.First().StringValue;

            // Assert
            result1.ShouldNotBeNullOrEmpty();
            result2.ShouldNotBeNullOrEmpty();
            result1.ShouldNotBe(result2);
        }