Skip to content

Generic DataLayer and Testing#1

Open
ncostar wants to merge 11 commits intomainfrom
remove-person-test
Open

Generic DataLayer and Testing#1
ncostar wants to merge 11 commits intomainfrom
remove-person-test

Conversation

@ncostar
Copy link
Copy Markdown
Collaborator

@ncostar ncostar commented Jun 21, 2021

No description provided.

ncostar added 4 commits June 20, 2021 18:19
Person attributes, create person
- Merged Create and Remove tests into one using Guard Assertion convention.
- Add Etag property to Person model.
- Tests green
@ncostar ncostar requested a review from DanielLarsenNZ June 21, 2021 03:08
Comment thread DataLayer/DataLayer.cs Outdated
Comment on lines +71 to +76
private T ItemWithETag(ItemResponse<T> response)
{
T item = response.Resource;
item.ETag = response.ETag;
return item;
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think we can just decorate the ETag property with a JsonProperty. See the Model class to see what I mean.

Comment thread DataLayer/Model.cs
[JsonProperty("id")]
public string Id { get; set; }

public string ETag { get; set; }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

[JsonProperty("_etag")]

and this should serialise / de-serialise from Cosmos without the need for an ItemWithETag helper

Comment thread DataLayer/Person.cs
@@ -1,4 +1,5 @@
using System;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Person.cs should be moved to the Test project and deleted from this project as per #2

Comment thread DataLayer/MockPeopleData.cs Outdated
@@ -0,0 +1,36 @@
using System;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MockPeopleData can be deleted

Comment thread DataLayer/Pet.cs
- Deleted MockPeopleData.cs
- Removed eTag parsing helper method
- Person Object Removal + Etag fix

Fixes #2 and #3
@ncostar ncostar force-pushed the remove-person-test branch from 7b9d235 to abedc2d Compare July 26, 2021 03:15
@ncostar
Copy link
Copy Markdown
Collaborator Author

ncostar commented Jul 26, 2021

Should be resolved now @DanielLarsenNZ

@ncostar ncostar changed the title Person Creation/Deletion + Integration Testing Generic DataLayer and Testing Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants