public FixtureForFindingOneRecord() { ExpectedEntity = new TestingEntity(); var subject = new TsSet <TestingEntity>(new FakeTsTable <TestingEntity>(new[] { ExpectedEntity })); // ACT ActualEntity = subject.FindAsync(ExpectedEntity.PartitionKey, ExpectedEntity.RowKey).Result; }
public FixtureForFindingOneRecord() { ExpectedEntity = new TestingEntity(); var subject = new TsSet<TestingEntity>(new FakeTsTable<TestingEntity>(new[] {ExpectedEntity})); // ACT ActualEntity = subject.FindAsync(ExpectedEntity.PartitionKey, ExpectedEntity.RowKey).Result; }
public async Task SaveByStandAlone() { TestingEntity entity = new TestingEntity() { Name = @"New Saved by standalone method" }; BasicResponse result = await entity.Save(); Assert.True(result.Correct); }
public async Task Save() { TestingEntity entity = new TestingEntity() { Name = @"Testing" }; BasicResponse result = await DataProvider.Save(entity); Assert.True(result.Correct); }
public FixtureForCreatingRecords() { ExpectedEntity = new TestingEntity(); var fakeTsTable = new FakeTsTable <TestingEntity>(new List <TestingEntity>()); var subject = new TsSet <TestingEntity>(fakeTsTable); // ACT subject.AddAsync(ExpectedEntity).Wait(); ActualEntity = fakeTsTable.Entities[new Tuple <string, string>(ExpectedEntity.PartitionKey, ExpectedEntity.RowKey)]; }
public FixtureForCreatingRecords() { ExpectedEntity = new TestingEntity(); var fakeTsTable = new FakeTsTable<TestingEntity>(new List<TestingEntity>()); var subject = new TsSet<TestingEntity>(fakeTsTable); // ACT subject.AddAsync(ExpectedEntity).Wait(); ActualEntity = fakeTsTable.Entities[new Tuple<string, string>(ExpectedEntity.PartitionKey, ExpectedEntity.RowKey)]; }
public void WillNotAddTypeToNestedObjectsOfSameClass() { using var store = GetDocumentStore(); using (var session = store.OpenSession()) { var test = new TestingEntity() { MyValues = new Dictionary <string, string> { { "", "" } }, MyCollection = { new TestingItemEntity { MyName = "bbbb" } } }; session.Store(test, "items/test"); session.SaveChanges(); } using (var session = store.OpenSession()) { var newCollection = new List <TestingItemEntity> { new TestingItemEntity { MyName = "abba" } }; session.Advanced.Patch <TestingEntity, ICollection <TestingItemEntity> >("items/test", x => x.MyCollection, newCollection); session.SaveChanges(); } using (var session = store.OpenSession()) { var obj = session.Load <BlittableJsonReaderObject>("items/test"); Assert.DoesNotContain("$type", obj.ToString()); } }
public FixtureForDeletingRecords() { // ARRANGE Entity = new TestingEntity(); var fakeTsTable = new FakeTsTable <TestingEntity>(new[] { Entity }); var subject = new TsSet <TestingEntity>(fakeTsTable); // ACT subject.DeleteAsync(Entity).Wait(); try { ActualEntity = fakeTsTable.Entities[new Tuple <string, string>(Entity.PartitionKey, Entity.RowKey)]; } catch (Exception) { ActualEntity = null; } }
public FixtureForDeletingRecords() { // ARRANGE Entity = new TestingEntity(); var fakeTsTable = new FakeTsTable<TestingEntity>(new[] {Entity}); var subject = new TsSet<TestingEntity>(fakeTsTable); // ACT subject.DeleteAsync(Entity).Wait(); try { ActualEntity = fakeTsTable.Entities[new Tuple<string, string>(Entity.PartitionKey, Entity.RowKey)]; } catch (Exception) { ActualEntity = null; } }
public FixtureForUpdatingRecords() { var originalEntity = new TestingEntity(); ExpectedEntity = new TestingEntity { PartitionKey = originalEntity.PartitionKey, RowKey = originalEntity.RowKey, ETag = originalEntity.ETag, Timestamp = originalEntity.Timestamp, MyProperty = Guid.NewGuid().ToString("N") }; var fakeTsTable = new FakeTsTable <TestingEntity>(new[] { originalEntity }); var subject = new TsSet <TestingEntity>(fakeTsTable); // ACT subject.UpdateAsync(ExpectedEntity).Wait(); ActualEntity = fakeTsTable.Entities[new Tuple <string, string>(ExpectedEntity.PartitionKey, ExpectedEntity.RowKey)]; }
public Client() { InitializeComponent(); if (DesignerProperties.GetIsInDesignMode(this)) { return; } Entity = TestingEntity0; TestingEntity0.Body.Position.X = 2; TestingEntity1.Body.Position.X = 5; TestingEntity2.Body.Position.X = 9; TestingEntity1.Body.Mass = 50.0f; TestingEntity2.Body.Mass = 25.0f; Time.RenderUpdated += RenderUpdated; }
public WhenAskedToUpdateARecord(FixtureForUpdatingRecords fixture) { _actualEntity = fixture.ActualEntity; _expectedEntity = fixture.ExpectedEntity; }
public WhenAskedToFindOneRecord(FixtureForFindingOneRecord fixture) { _actualEntity = fixture.ActualEntity; _expectedEntity = fixture.ExpectedEntity; }