Coder Social home page Coder Social logo

spyfinder's Introduction

#SpyFinder

##Author: Robert Bicknell

##Date: April 20th 2019

##Description: SpyFinder is a minimal web application to manage a list of spy names and codes, and to check messages for the presence of a spy's code.
SpyFinder stores spy names and codes in a PostgresSQL database as defined in the configuration setting
PROD: "Host=localhost;Database=Spies;Username=postgres;Password=password" TEST: "Host=localhost;Database=Spies;Username=postgres;Password=password"

##HTTP GET Purpose: Returns list of Spies and their codes. Example request URL: GET http://localhost/api/spies Example request payload : none. Example response payload : [{"name":"Ethan Hunt","code":[3,1,4]},{"name":"James Bond","code":[0,0,7]}]

##HTTP PUT Purpose: Saves a new Spy to the database. Example request URL: PUT http://localhost/api/spies Example request payload : { "name" : "James Bond", "code" : [0,0,7] } Example response payload : "Spy successfully added."

##HTTP DELETE Purpose: Deletes a Spy from the database Example request URL: DELETE http://localhost/api/spies/ Example request payload : none. Example response payload : "Spy successfully deleted."

##HTTP POST Purpose: Checks a message for a spy's code and return whether the code is present. Example request URL: POST http://localhost/api/spies/ Example request payload : { "Message" : [1,0,1,0,7,1], "Spy" : "James Bond" } Example response payload : true/false

###Preparation * Install Postgres * Create two copies of teh SPies datbase, for PROD and TEST using the SQL script contained in the SpyFinder Data project: CreateDatabase.Spies.Postgres.sql * Modify the Configuration settings for the PostgresSQL PROD and TEST connections strings as required. Example: "Host=localhost;Database=Spies;Username=postgres;Password=password"

###Developer Testing notes for QA: * Testing was performed using Postman ** Configure the correct HTTP Verb, URL, including any custom port ** Add a Content-type header with MIME-Type 'application/json' ** Add a request payload if required as shown below for each request. ** Verify the returned result by comparing to the sample outputs shown for each request.

Not suported:
	* authorization
	* https
	* cors
	* csrf tokens
	* caching
	* logging 
	* custom exception handling

###Technology: .net Core 2.2.0 Npgsql Npgsql.EntityFrameworkCore.PostgreSQL 2.2.0 PostgresSQL 11

###Notes The method of checking a message for a code compares elements of integer arrays. Examples:

	Message			Code				Result
	-------------------------------------------------------
	[1, 0]			[1, 0]				Spy is present 
	[1, 0]			[0, 1]				Spy is NOT present 
	[1, 0, 2]		[1, 2]				Spy is present 
	[1, 0]			[10]				Spy is NOT present 

spyfinder's People

Contributors

robertbicknell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.